How does temperature affect the atmosphere and cause weather?
Temperature is simply a measure of energy present. The heating and cooling of the atmosphere cause currents as cold air moves towards warmer air.
The most basic thing to understand is that warm air wants to rise while cold air wants to sink. Hot air contains fewer molecules per cubic meter while cold air contains more, hence the warm air will rise up over colder air. The most common example of this is the existence of a hot or cold front. These fronts are simply boundaries between hot and cold air.
As the sun heats the earth it cause water on its surface to evaporate. The evaporated water is absorbed by warm air and rises creating clouds. The greater the evaporation the more clouds that are created. At the same time, if conditions on the earth's surface are warm or hot, there is a rise in the ambient humidity. When you have high humidity and a front moving across it, the motion causes the formation of rain storms, thunderstorms, snow storms, etc.
Where you have a hot or cold dry area a high pressure system is formed. The air in a high pressure area moves clockwise. In a low pressure area, humid air with lots of clouds, there is a counter clockwise motion of air. There is a constant battle between high and low pressure systems going on all over the earth which in turn causes our weather to be as it is.
And always remember, heat is a type of energy and when it is not there, we called as cold. So cold is just absence of heat energy and that's why it is not an energy.