Gravity is a pull between any two objects that have mass. The more mass the objects have, the stronger the pull, and the farther apart they are, the weaker it gets. The Sun holds about 99.8 percent of all the mass in the solar system, so its gravity is what keeps the eight planets moving in their orbits. Without that pull, each planet would move off in a straight line. Earth's gravity keeps the Moon in its orbit around Earth in the same way.
Gravity does not stop where the air ends. The International Space Station orbits about 400 kilometers above the ground, and gravity there is still about 90 percent as strong as it is on the ground. Astronauts float inside the station because they and the station are falling around Earth together. The station moves sideways so fast that as it falls, Earth's curved surface keeps dropping away beneath it.
Astronomers often measure distances in the solar system in astronomical units (AU). One AU is Earth's average distance from the Sun, about 150 million kilometers. Pluto was once called the ninth planet, but since 2006 astronomers have classified it as a dwarf planet, because it has not cleared other objects from the region around its orbit.