The layer of gases that surrounds a planet and is retained by its gravity.