Temperature is just an expression of mean kinetic energy of particles. If gases (especially light gases) are hot enough, their kinetic energy can correspond to a velocity that actually exceeds the escape velocity of Earth's gravitational well. This is how hot gases can be removed completely from the Earth's atmosphere (and then solar wind & radiation take care of removing it from there). Even at today's atmospheric temperatures, helium gas (molecular weight of 4 atomic mass units, much lighter than molecular oxygen, nitrogen, etc.) can escape from Earth's atmosphere.