My answer is
5899 moves for white, 5898 moves for black.
Explanation:
As I understand it, the 50 move rule means that if the players do 50 moves each without a capture/pawn-move, the game is drawn. In chess it is apparently customary to only count the number of moves by one player (e.g. a 32-move game means white played 32 moves, black 31 or 32 moves), but in the rest of this answer I will count moves of both players added together.
The threefold repetition rule can be ignored, because the players are cooperating and there are always enough pieces and enough room to avoid repetition for 50 moves each. The basic idea for creating the longest game is to do as many pawn moves as possible, interspersing those pawn moves and any capturing moves with 99 non-pawn non-capturing moves whenever possible.
Each pawn can move at most 6 times before it reaches the back row. With 16 pawns, that makes (at most) 6*16=96 pawn moves. For a pair of opposing pawns to both reach the back row, at least one of them must make a capture, so at least 8 of the 96 pawn moves are also captures. It is fairly easy to check that it can be done with only 8 captures by pawns.
Including the pawns, there are 30 pieces that can be captured before there are only the two kings left. The pawns capture 8 of those, leaving 22 more captures by other pieces.
So we have a total of 96+22=118 moves that are pawn moves and/or captures.
The 99 moves before the first capture/pawn-move can be moves by the knights. So you may think that the game could last 100*118=11800 moves, where every 100th move is a pawn move or capture, and where the last move is the capture that leaves only the two kings on the board. However, in such a game all pawn moves and captures would be performed by one colour, and we need both players to make captures and pawn moves. It is not possible for one player to do all the pawn moves and capture before the other player, so we must switch colour at least twice.
Unfortunately (as Bass points out in the comments), two switches is also not sufficient. Black is the first to do captures/pawn-moves, but he should not do captures using his pawns because the white pawns are still in their starting positions. The 8 available capture-by-pawn moves must be used for getting pawns to pass each other. When it is white's turn for captures/pawn-moves, he can promote his pawns, but he cannot yet capture blacks pawns because they still have more moves to do. When it is black's turn, he can get his pawns promoted, but finally white must be allowed to capture black's former pawns again. So this means three switches of colour are necessary, and very probably sufficient.
So three times in the game, there is one fewer move between successive captures/pawn-moves. This leads to a game of 11797 moves, or 5899 moves for white, 5898 moves for black.