Djokovic, the top seed, beat Federer 7-6 (5), 1-6, 7-6 (4), 4-6, 13-12 (3) in London. Sunday's match was the first fifth-set tiebreaker in Wimbledon singles history after a recent rule change permitting such a scenario if the score reached 12-12 in the final set.
The championship featured five intense sets, including 35-shot rally during the fourth set. Sunday's match went four hours and 57 minutes -- the longest Wimbledon men's singles final match.
"This always has been the tournament for me," Djokovic, of Serbia, said. "Where I wanted to participate, where I wanted to win one day."
Djokovic moved to 26-22 (10-6 in Grand Slams) lifetime against Federer, of Switzerland.
Djokovic beat Kevin Anderson last summer for his fourth career Wimbledon championship. He also won Wimbledon in 2011, 2014 and 2015.
Federer last won Wimbledon in 2017. He also won the event every year from 2003 to 2007 as well as 2009 and 2013.
John McEnroe, a commentator Sunday's match for ESPN, was involved in his own marathon match at Wimbledon. In the 1980 men's singles final, Bjorn Borg defeated McEnroe 1-6, 7-5, 6-3, 6-7(16-18), 8-6 to win the match. It was regarded at the time as the greatest match ever played.
The longest tennis match of all-time was an 11-hour, five-minute first-round match at Wimbledon in 2010 between John Isner and Nicolas Mahut. That match went across three days before Isner won the final set 70-68.
Federer and Rafael Nadal played a five hour, five minute final round at the 2006 Italian Open. Federer lost that match, too.
Federer's 2009 Wimbledon final match at Wimbledon went 77 games, the longest singles final match by number of games.
Tiebreakers first debuted in a Grand Slam at the 1970 US Open. Matches had best-five-of-nine-points tiebreakers and best-seven-of-12-points tiebreaker. The nine-point tiebreaker debuted at Wimbledon in 1971.
Simona Halep defeated Serena Williams on Saturday to win her second Grand Slam and first Wimbledon title in women's singles.