Our atmosphere is only about 100km thick before the official start of space. That is a mere 1.57307% of the radius of Earth (6,357km). The difference between the gratitational force at sea level and 100km up would be minimal. If that is what regulates the size, there would be a fine line between having a thin atmosphere only a few times that of Mars, and a very thick one like Venus (about 90 times the pressure of Earth's).
Are we just lucky that the amount of gas left on top when Earth formed, plus what was outgassed, plus what was mopped up from around Earth's orbit later, was the right amount, or does something else determine the amount?