How does the Earth have enough gravity to hold on to its atmosphere? I'm looking for numbers/math that describe how earth (or any other planet) holds on to it's atmosphere.
Presumably, we would be able to determine the exact atmospheric pressure that we would expect to have on a planet of a given radius/mass/density, assuming that we start with infinite amount of atmosphere in which most of it disperses till we get into an equilibrium.
 A: This actually isn't too hard. The Maxwell-Boltzmann distribution provides the average velocity of gases. The most probable speed (which is only good for order of magnitude estimates) is:
$v_p=\sqrt{\frac{2kT}{m}}$
You can put in the numbers: $T$ is the temperature of the Earth's surface, about $300K$, and $m$ is the mass of whatever gas you're interested in. For example, with hydrogen, you get that the most probable velocity is about $2225 m/s$.
Compare that to Earth's escape velocity, which is calculated from Newton's laws as about $11.186 km/s$. This is much larger than the most probable velocity of hydrogen, which indicates that most hydrogen atoms would not escape. However, a substantial-enough fraction does (see the shape of the Maxwell-Boltzmann distribution). The remaining hydrogen thermalizes, which leads to more hydrogen that's moving faster than the escape velocity, etc, so that hydrogen eventually escapes the atmosphere. 
You can calculate the fraction of hydrogen that's moving fast enough to escape by integrating the Maxwell-Boltzmann distribution, and the same goes for other gases.
You can also read more about the entire phenomenon at Wikipedia's article on atmospheric escape.
