What keeps our atmosphere attached to Earth?

Our atmosphere is a mixture of gases that surround Earth. It is kept in place by the pull of Earth's gravity. If Earth was a much smaller planet, like Mercury or Pluto, its gravity would be to weak to hold a large atmosphere.