Good question. The atmosphere is an extremely important part of life on Earth. You can think of it as a nice cozy blanket since it helps keep the planet warm. Plus, it acts as a filter for harmful pollutants, and it contains the Oxygen we need to live.
It's also like a water bottle lid. That sounds less comforting, but, without it the water would evaporate and go to space!
Some quick facts about the atmosphere before getting into why it helps keep water on the Earth's surface. It is a thin film of gas made up of ~78% Nitrogen, 21% oxygen, ~0.9% argon, 0.4% carbon dioxide, plus a few other elements. It clings to the Earth by gravity. Its mass accounts for 1 millionth of the whole planet. And about 80% of the atmosphere is contained within the first 7.5 miles (the troposphere), meaning it gets thinner as you go out to space.
Ok, now that we have the bases covered, let's talk about why it helps keep Earth's water...on Earth. As water evaporates from the Earth's surface, it goes from being a liquid to a gas (vapor). As this water vapor rises, it also cools (ever go up into the mountains and have it be much colder than down in the valley?). When the water vapor cools, clouds form, and clouds are what holds all this evaporated water! They move around various parts of the atmosphere until they drop all the water back to Earth as rain (sometimes much, much further away from where it evaporated)! Crazy how the answer was right above you the whole time eh :)
Fun fact: A drop of water may spend 3,000 years in the ocean before evaporating into the atmosphere. Once in the atmosphere, it stays only for an average of 9 days before falling back to Earth.
Another fun fact, clouds form because of dust particles in the air as well.
Concluding remark: The atmosphere can do too good of a job keeping us warm, especially as we continue to add CO2 to the atmosphere. This is what causes the greenhouse effect, which results in global warming and climate change. There is a lot of reading online for that topic, which I highly recommend exploring.
Here is an extra link where you can read about water stored in the atmosphere.
Hope you enjoyed learning about the atmosphere. Stay Curious!