The correct answer is gravity.
The planets and other heavenly bodies are attracted towards the earth by the earth's gravity. The pull which is formed by the gravity of earth holds the objects near the earth surfaces. The planets and atmosphere is also kept around the earth's surface by the gravity.