Novak Djokovic has been ranked inside the top 2 in the world for the last 324 weeks and he is guaranteed to remain in the top 2 for at least two more weeks. That means Djokovic will have been ranked either No. 1 or No. 2 in the world six and a quarter years.
For some context, here are the longest streaks of other top players
Roger Federer: 347
Novak Djokovic: 324
John McEnroe: 321
Jimmy Connors: 290
Ivan Lendl: 280
Rafael Nadal: 213, 105
Pete Sampras: 172, 155
Bjorn Borg: 135
Andy Murray: 81
For Djokovic to catch Federer, he has to remain inside the top 2 until the week of the Paris-Bercy Masters 1000. That right now looks very unlikely with Rafael Nadal almost certainly catching Djokovic before the Serb has a chance to catch Andy Murray.
There are four players that have a shot to catch Djokovic in the rankings at Roland Garros: Marin Cilic, Milos Raonic, Stan Wawrinka and Nadal. This is a look at what Djokovic needs to do to prevent each of the following players from passing him in the rankings.
Cilic needs to win the title to have a chance to surpass Djokovic.
-Djokovic needs to reach at least the quarterfinals to guarantee that Cilic doesn't pass him.
Raonic needs to win the title to have a chance to surpass Djokovic.
-Djokovic needs to reach the final to guarantee that Raonic doesn't pass him.
Wawrinka needs to reach the semifinals to have a chance to surpass Djokovic.
-If Wawrinka loses in the semifinals, Djokovic only needs to arrive to Paris to remain No. 2.
-If Wawrinka loses in the final, Djokovic needs to reach the semifinals to remain No. 2.
-If Wawrinka wins the title, he will surpass Djokovic in the rankings.
Nadal needs to reach the second week to have a chance to surpass Djokovic.
-If Nadal loses in the round of 16, Djokovic only needs to win his first round match.
-If Nadal loses in the quarterfinals, Djokovic must also reach the quarterfinals.
-If Nadal loses in the semifinals, Djokovic must also reach the semifinals.
-If Nadal loses in the final, Djokovic needs to be the player that beat Nadal in the final.
-If Nadal wins the title, he will be the No. 2 player in the world.
This means that Djokovic is guaranteed to remain No. 2 in the world if he wins the title in Paris. If he does remain No. 2 after Roland Garros, he is likely safe until he loses 1000 points in Canada. That would add 10 more weeks to his total, putting him at 334 consecutive weeks inside the top 2 in the world.