-- Gravity causes forces of attraction between masses.
-- Every molecule of every component of our atmosphere has mass.
-- Gravity causes forces of attraction between the molecules of the
atmosphere, which may largely be disregarded, but more importantly
between the molecules of atmosphere and the Earth.
In other words, gravity has the effect of keeping the atmosphere in place
around the Earth. Without gravity, there would be no atmosphere.
(There would be no Earth either, but that's another story.)