Djokovic took the first set 7-5, lost the next 4-6 and won the third on a tie-break before eighth-seeded Argentine Del Potro saved two match points en route to claiming the fourth set tie-break.
Neither man had previously dropped a set in this year's tournament and Djokovic prevailed 6-3 in the decider.
The previous semi-final record of four hours, one minute was set in 1989 when Boris Becker beat Ivan Lendl in five sets.
The new mark is six minutes shy of the longest Wimbledon final, Rafa Nadal's four hour, 48 minute victory over Roger Federer in 2008, but remains way adrift of the tournament's longest match.
That was the 11 hour, five minute first-round epic between John Isner and Nicolas Mahut in 2010 which Isner won 70-68 in the fifth set.
- Sports & Recreation
- Del Potro