World number 21 Djokovic added the 2018 title to his wins in 2011, 2014 and 2015 as he became the lowest-ranked champion since Goran Ivanisevic in 2001.
It also took his Slam total to within one of Pete Sampras and just four behind the 17 of Rafael Nadal who he defeated in the semi-finals.
Anderson, the eighth seed, was the first South African in the final in 97 years and was bidding to become the first man from his country to be crowned Wimbledon champion.
However, he had spent 21 hours on court getting to the final and that marathon effort came back to haunt him at the worst possible time despite a late rally when he had five set points in the third set.
Victory was 31-year-old Djokovic's first at the majors since he completed the career Grand Slam at Roland Garros in 2016.
It also came just a month after he threatened to skip Wimbledon after a quarter-loss exit in Paris and with his ranking at its lowest in over a decade.
Weary Anderson had needed five sets and saved a match point to beat Roger Federer in the last-eight.
He then played six hours and 36 minutes to defeat John Isner in the semis in the second longest singles match ever played at a Grand Slam.
It was hardly surprising that he suffered a dramatic power failure in the first two sets against a player who he had defeated only once in six previous meetings and that was 10 years ago.
Having arrived in the final with 172 aces to his name, Anderson managed just 10 on Sunday.
He also failed to convert any of his seven break points.
- Sluggish Anderson -
Anderson, sluggish in the 30-degree heat having played 21 hours at the tournament already, was broken on a double fault in the first game.
That set the tone and Djokovic broke again in the fifth game on his way to securing the opener.
The Serb conceded just three points on his serve.
In the first Wimbledon final featuring two players over 30, Anderson's chances looked slim when he called for treatment on his upper right arm during the changeover.
It was far from the spectacle that the crowd and Royal Box -- which included the Duke and Duchess of Cambridge, Prime Minister Theresa May as well as actors Hugh Grant and Benedict Cumberbatch -- had anticipated.
The second set followed a familiar pattern, Djokovic breaking in the first and fifth games and fighting off the only break point he faced in the eighth game.
Late in the set, the exhausted Anderson's total number of games played in his seven matches at Wimbledon set a new record for the most ever in one edition of the tournament.
Anderson battled in the third set where he had five sets but all were saved by Djokovic, who went to victory when the South African netted a return.