Some planets and moons are covered in a thin layer of gases, called an Atmosphere, which is held in place by the gravity of the body. This means that small planets and moons, which have small gravitational pulls, tend not to have them.
The higher you get from the surface of the planet the thinner the atmosphere becomes, which is why it becomes harder to breathe when you're on top of a mountain. It's also why we put telescopes on mountains, as the atmosphere can blur our images by an effect we call astronomical seeing.
On Earth our atmosphere protects us from harmful radiation from the Sun. It also provides us with air to breathe, but not all atmospheres are the same. In fact, the Earth's atmosphere, which is mostly nitrogen and oxygen, is the only one we have found that we can breathe. On other planets, with different atmospheres, perhaps life has evolved to 'breathe' other gases.