The rating points awarded for a win/loss are related to the ratings of the players at the time the game finishes, according to the chart in Thread 80000. If either player is provisional, only half the relevant points are awarded.
First, the best place to get serious answers to actual questions is the Help Forum. This is the place to get generally abused, demeaned and ridiculed. Those of us who frequent this General Forum have no learning curve.
Second, the best answer to your question (for the actual formula and how it came about) would be to enter "ELO ratings chess" into your search browswer. I'm not providing a link as there are many excellent explanatory sites there, including wikipedia.
Players at RHP are rated using the following formula:
New Rating = Old Rating + K * (Score - Win Expectancy)
K is a constant (32 for 0-2099, 24 for 2100-2399, 16 for 2400 and above)
Score is 1 for a win, 0.5 for a draw and 0 for a loss.
The Win Expectancy is calculated using the following formula :
Win Expectancy = 1 / (10^((OpponentRating-YourRating)/400)+1)
In short, if you beat a player with a higher rating than yours, your rating goes up more than if you beat a player with a rating lower than yours.
Similarly, if you lose to a player with a rating higher than yours, your rating drops less than if you lose to a player with a lower rating than yours.
Analog with draws, except that the rating change is less than for wins / losses.