The temperature of something depends on how much the molecules that make up that thing are moving. Air temperature depends mainly on how much heat energy from the sun is reaching the air around us. The sun has a lot of energy which causes molecules to move around a lot, which is what causes higher temperatures. On a cool day, less heat from the sun will reach the air around us due to cloud cover, or whatever, which means molecules will have less energy to move around and so have a lower temperature.