The Longest Game of Chess
Starting with the theoretical, we can calculate the longest possible game of chess. When we talk about 1 move we mean 1 move for white and 1 move for black. There is a rule that states that if no checkmate, pawn movement or piece capture happens within 50 moves then the game is declared a draw, i.e. any move that permanently changes something about the board state. This is to stop people playing on in vain with insufficient material to be able to checkmate.
The longest game would have to have white make 50 waiting moves and black to only do something permanent on their 50th move, like moving a pawn forward one. After another 49 waiting moves again, one of the players makes another permanent step.
These waiting moves can be shuffling knights around at the start of the game (carefully planning within each batch of 50 that the same position doesn't occur 3 times to avoid drawing the game) and then later by shuffling other pieces backwards and forwards.
The number of permanent moves we can count as each pawn getting to the other side (without jumping forwards two spaces) which is 6 spaces * 16 pawns = 96, plus every piece getting captured barring one = 29. You should avoid using pawns to do any captures because that would move them forwards. The remaining piece (plus the 2 kings) will be used to set up the final checkmate which will happen on the 50th move of that batch. Overall this makes (96 + 29 + 1) * 50 = 6300 moves.
Since the 50 move rule has been brought in we have discovered endgames which are won for one side but take longer than 50 moves to complete. At first FIDE (the main chess body) started having exceptions for particular cases where they would have a 100 rule move instead, but with the advent of the computer age the number of these cases became too large and so they standardised on just reinstating the 50 move rule for everything.
The longest series of moves that we have found so far until something is captured or a pawn moved in a won game is in the position below where it takes 545 moves:
In terms of actual games played, the longest recorded match in terms of moves was between Nikolić and Arsović in Belgrade 1989, which lasted for 269 moves and took 20 hours and 15 minutes to complete a drawn game. I find it surprising how low this is; I've seen end games go above 100 moves in club games and I would expect the see quite a long tail to the distribution of game length.