In another post it was written that for games played during the 2013 World Championship match, Carlsen gained 3.7 points if he wins, Anand gained 6.3 points if he wins, and that in a draw Carlsen lost 1.3 points that Anand gained. How were these numbers arrived at?
By "points" you probably mean rating "points". Rating is a measure of player's strength, not a prize for their performance. To me, talking about "gaining rating points" sounds a bit wrong. A player's rating increases if he wins and decreases if he loses. In the case of a draw, player's rating moves closer to his opponent's rating (or does not change if the rating difference is small).
Here's how the Elo system works:
The result of a game is 1 for a win, 0.5 for a draw, and 0 for a loss. The expected score of a player A against player B is a function of their rating difference. For FIDE ratings, see the tables in Section 8 here. After a tournament or a match, the rating is then updated using the formula
(new rating) = (old rating) + K * (result - expected result),
where in the FIDE system K=30 for players with few games, K=10 for players whose rating has been above 2400, and K=15 for other players.
If player A's expected score is E, then player B's expected score is 1-E. Thus, when two players play against each other e.g. in a match and their K-factor is equal, one can easily see player A's rating increases by the same amount player B's rating decreases.
For more information, see e.g. the Wikipedia article.
Two links for convenience: