How does the game determine how much damage you take? Is there a formula out there that determines how many hearts of damage you take per blocks fallen?
Fall damage is calculated by calculating the distance fallen (in blocks).
Specifically, Falling Damage =(x-3)/2; where x=number of blocks fallen.
This means that you can safely drop 3 blocks at once without taking damage. Jumping gives 1½ blocks worth of upward momentum, so if you jump off another block, you can only fall one and a half blocks safely.
Ladders, water, and other blocks can mitigate this. Ladders can by cancelling your momentum (and resetting your fall distance) and water because it's water, and generally stops falling damage in any video game that fails to model surface tension!
More information available here.
You can make fall safety nets doing that. Say you dig a large shaft and want to get down quickly and safely. you can put a water source block 3 meters/blocks above the ground and put a sign right below it. The floating water will lower, but not reset your speed. So make sure you place enough waterblocks between you and the ground. (3 blocks slows you down enough for practically any height).
Damage you take = distance fallen(in blocks)-3
Source: Minecraft Wiki