It can get pretty hot if you are playing a graphically intense or fast paced game (like Wipeout HD, any of the Uncharted games or God of War III - among others). If it gets hot just staring at the XMB, though, there could be something wrong. If the fan is running, it is doubtful that anything is damaged. If it gets too hot, the PS3 will shut itself down before it overheats.
Try unplugging it and use the hose from a vacuum to clean out any dust buildup from the vents around all sides of your PS3. Also, make sure it has at least 8-10 inches of clearance on all sides, and preferably at least 12-18 inches on the back side (since most of the air is blown out the back).
Warmer air coming out of the exhaust is better, as the cooling system works to bring heat out of the system. If it's cool or cold even when playing a game, you might have a problem as heat from the GPU/CPU is not being exhausted.