Canned air is a common tool used for working on computers and general electronics. The strong puffs of air are handy for removing dust from the mouse and keyboard, monitors, fans and other equipment. If you have used canned air, you've noticed the peculiar reaction that occurs: the can gets cold and, in some cases, frost forms on the can and the straw attached to the nozzle.
TL;DR (Too Long; Didn't Read)
The expanding gas that comes from canned air absorbs heat from the can, making it cold.
Inside the Can
Canned air is not the same as the air we breathe. It's commonly a mixture of nitrogen and other relatively harmless gases that are compressed to 40 to 70 psi (pounds per square inch) turning them to liquid. Some of these gases also displace the oxygen in the air, so it is always best to use them with proper ventilation. Because these gases are compressed to liquid form, when you turn the can upside down and press the nozzle, liquid will come out before it turns to gas. A pocket of gas sits at the top of the can, preventing liquid from spraying out when the can is right side up.
Thermodynamics in Action
The reason the can gets cold after being used is due to a process known as adiabatic cooling, a property of thermodynamics. A gas, initially at high pressure, cools significantly when that pressure is released. The compression needed to turn a gas to liquid allows a large amount of gas to fit in a relatively small space, and when that gas is released to a large space, it rapidly expands to fill the space.
Movement of Energy
The evaporation of the liquid inside the can results in a drop in its internal heat energy, and it absorbs a large amount of heat from the surrounding air and environment -- in this case, the metal can. When the liquid inside absorbs the heat from the can's metal body, the can cools down rapidly. As the expanding gas leaves the can, it also absorbs heat energy from the nozzle and straw, and anything else the gas comes into contact with. For example, if you spray a keyboard, you'll see a thin white layer of frost form on the keys briefly.
Out of Breath
With prolonged use of the canned air, you might notice that the force of the air stream weakens over time, and the can becomes too cold to comfortably hold in your hand. The heat energy from the can has all gone into evaporating the liquid inside; when the can itself becomes cold, not enough heat remains to vaporize more liquid. To remedy the "out of breath" condition, set the can down and let it warm for a few minutes. This restores the strength of the air bursts.
A Chilling Effect
The can carries a warning label telling you to avoid spraying onto your skin; the rapid absorption of heat can easily cause frostbite. The frost that forms on the can and nozzle comes the condensation of water vapor in the surrounding air.