If we talk about outer space, the temperature conditions are highly variable. At those conditions, any biotic component or an organism cannot survive. The atmosphere of a planet acts as a barrier against these conditions.
1) It maintains a range of temperatures at which organisms can survive.
2) It maintains other factors like a steady-state of components like water, a specific percentage of gases, gravity.
3) Prevents us from the harmful U.V radiation coming from the sun.
4) Maintains surface components like soil which are essential for survival.