In short:
Players gain or lose points depending on their opponent's ranking. These points last forever. Players can also earn bonus points by reaching far into the main draw or even the finals of a tournament. These bonus points last for limited time and will be deducted later again. The amount of points also depends on the type of event i.e. the world championships are of a higher order than a Challenge series tournament.
If you visit the rankings (http://ittf.com/ittf_ranking/), you can click on a player's ranking points to see how they earned or lost points during the previous month.