Water normally freezes at 0°C (32°F). Salt lowers the freezing temperature. (That is, it can remain a liquid at much lower temperatures.)
When sprinkled on ice, the salt lowers the freezing temperature of the water which effectively melts the ice when the salt dissolves into it. There is a limit to how low it can reduce the temperature, though. If the temperature drops below -9°C (15°F), it's too cold for the salt to dissolve into the ice.
When making ice cream, the salt lowers the temperature of the ice and water sufficiently enough to freeze the cream.
The answer is latent heat. The specific latent heat of vaporisation, L_v, of a substance is the energy input required for each kilogram to be converted from liquid to gas by evaporation. The 'specific' means per kilogram, so more generally latent heat of vaporisation is the energy taken in during the process for a given mass.
Here we are not vaporising the substance. We are in fact condensing it, the reverse process. All this means is the latent heat is released as electrostatic potential decreases in the water, as opposed to being absorbed. I hope this helps you :)