Salt is very commonly added to ice even at room temperature to prevent it from melting. Can anyone explain how does it really work?
Uncle Al is correct. Colligative properties are properties of solution in which only the ratio between number of particles of solute and solvent are considered (often expressed in different forms, such as moles of solute per kilograms of solvent for molality); the identities of either are irrelevant. So we could dissolve sodium chloride in water or magnesium bromide, but the general properties will be the same (though note that the magnitude of freezing point depression and similar properties will be slightly different depending on the substance).
In particular for salt water, the point at which the solution will freeze is depressed. To understand this, we must understand what occurs when pure water freezes. In general terms, when a liquid freezes, its normally hectic and randomly moving particles form a stable, packed structure that we call a solid; a hexagonal structure in particular for water at standard conditions. The specifics are more complicated, but this is the main idea.
However, if you introduce a solute into the pure water, such as salt, the solute particles are getting in the way of the formation of the packed structure. As a result, the temperature must be lowered slightly further in order for the solvent (i.e. water) molecules to properly overcome the solute molecules acting as obstacles for the formation of the solid structure.
In fact, when the solvent freezes, more often than not, the solute particles are often excluded, either pushed outside or trapped inside small pockets. In the case of salt water, a eutectic system is created, if you're interested in learning of them. Salt water itself cannot freeze into salty-ice or otherwise.
Colligative properties, then freezing point depression. The melting point of ice is lowered -1.86 C/molal of solute particles. One molal is one mole of particles/kg of solvent (NOT solution). Addition of salt lowers the melting point of water, causing the ice to melt, absorbing the latent enthalpy of fusion, until the system temp lowers to its equilibrium value.
If you want your ice to stick around, thermally insulate it from the surrounding environment. You must interdict conduction, radiation, and convection.