What is the relationship between the atmosphere and gravity?
Not as much as you think.
Although it is obvious that gravity is necessary for a planet to have atmosphere, the amount of gravity is not as important as you might think.
Venus is only 80% of the mass of the Earth and yet it has almost 100 times the atmospheric pressure.
Titan, the largest moon of Saturn, has a mass about 1/50th of the Earth but an atmosphere about 40% more than Earth's atmosphere.
Other things can effect the ability of a body to hold an atmosphere, like solar winds for example, but it seems the most important thing is that there was gas in the vicinity of the planetary body when it formed.