TheGrobe, I'm happy we see things the same way, not the same way as MsJean!
I have calculated the longest possible chess game

To the OP Deranged, your answer of 5900 is a little simplistic. But it's in the right ballpark.
MrEdCollins, 5949 is also in the ballpark, but whomever came up with it rightly did not post their analysis (probably because it was too simplistic as well).
Cobra91, your number of 5898 matches exactly mine in the comments to the below referenced blog post by kurtgodden, except that I gave the answer with an extra 49.5 moves (99 ply).
RetGuvvie98, you're funny!
CM ilmago, yes your calculations also match exactly mine in the below post.
(note that with three separate people coming to the same answer it is very likely correct).
TheGrobe you've quoted exactly the post I did!
DavidMertz1 I do not think that losing the right to castle resets the move count. Also, making a move other than en passant in a position where en passant is legal does not reset the move count. If you believe otherwise, can you post a link? This would change matters of course.
http://blog.chess.com/kurtgodden/the-longest-possible-chess-game
Oh ! you left me out ! now we have to play a game and you have to lose ....there is no little devil smiley face but I am one he he!

Actually, the longest possible chess game is 50*117 + 25 = 5875 moves long, because of the twenty-five move rule. When it's down to kings plus a queen or rook, only 25 moves can remain.
There is a 25 move rule? I never heard of that. So if I have a king and queen vs a king and rook, I have just 25 moves to capture the rook?
The 25 move rule just says that when a player survives 25 moves with only the king left, the game is a draw.

She is so not right. I think that we (the community) have the right answer anyways. 5898, under certain assumptions.
Of ccourse I am right !

Here's an even harder problem: What if the 50-move rule didn't exist? How long could a game be then? (Don't forget the limitations of threefold repetition!)

Actually, the longest possible chess game is 50*117 + 25 = 5875 moves long, because of the twenty-five move rule. When it's down to kings plus a queen or rook, only 25 moves can remain.
There is a 25 move rule? I never heard of that. So if I have a king and queen vs a king and rook, I have just 25 moves to capture the rook?
The 25 move rule just says that when a player survives 25 moves with only the king left, the game is a draw.
House rules don't count here.

Here's an even harder problem: What if the 50-move rule didn't exist? How long could a game be then? (Don't forget the limitations of threefold repetition!)
Yes, you're right, that is a more difficult problem.
And of course, on another note, all of our calculations change depending on the rules - specifically, in the past, FIDE has changed the rules for certain positions to get more than 50 moves. But then they went back to just 50 moves, when more exceptions were found. If you end up with 3 knights vs 1 knight, you're SOL.

I suspect, though, that any game that passes through one of those exception positions would actually end prematurely on insufficient material, and almost certainly have more possible moves chopped off the end as a result than were added by the spcific exception (or even exceptions if tranposition from one to another is possible) making them shorter games overall.

Here's an even harder problem: What if the 50-move rule didn't exist? How long could a game be then? (Don't forget the limitations of threefold repetition!)
Reminds me of another similar thread that asked us to pontificate on the likely length of a perfect game and some discussion around whether it could possibly be infinite or not.
(Not, by the way - eventually one of the two sides' best moves will be to force the draw under three-fold repetition)

Well, the kings must occupy the same position three times. So, they must occupy as many different positions as possible in order to prolong the game, but eventually each position will have been done thrice over. The tricky part in calculating this is that the kings cannot stand adjacent.

@ frixz
@thegrobe
@ NM Ozzie
Now that this is said and you have ignored me you all owe me a game and all of you have to lose !

Well, the insufficient material rule would apply first, but for the sake of the academics of the thing all you have to do to get a maximum is calculate the number of unique positions with only two kings and assume that they can conceivably be consecutively cycled through (not sure about the validity of this assumtion, hence the "maximum"):
For the white king on each of the 36 non-perimeter squares there are 55 legal positions for the black king. 36x55 = 1980
For the white king on each of the remaining 24 non-corner squares there are 58 legal positions for the black king. 24x58 = 1392
For the white king on each of the four corner squares there are 60 legal positions for the black king. 4x60 = 240
1980+1392+240 = 3612
so from the first position with only two kings remaining, you could possibly make 3611 moves before being forced to repeat (on the 3612th), and then once again so after 7224 moves from the first position in which there were only two kings left you will necessarily have encountered the same position three times.

This whole thing would be a decent interview question for programming at a place of business such as chess.com.
Yes, that makes four independent 5898's.