As Creeper indicated in his response, with centerfire pistols, you're generally OK dry-firing, and it should generally be avoided with rimfire weapons. But, there are exceptions.
Ruger rimfires have firing pin stops, and unless that part is worn or broken, they allow dry-firing. (In fact, you MUST dry fire when field stripping and reassembling the weapon.) Some centerfire guns shouldn't be dry-fired - as is the case with two of the newer Kel-Tecs [the P3AT and PF9], the Beretta Tomcat, and a few other guns.
Check the owner's manual. With some rimfires, the chamber wall can be damaged; with some centerfire guns, the firing pin or firing pin block assemblies can be damaged.
If you don't have a manual for your gun, check one of the many websites that has copies... Here's an excellent site:
http://www.stevespages.com/page7b.htm