Why does your windows XP keep turning off unexpectedly?

The CPU could be overheating. Things to consider : Is it a laptop or desktop? Are any of the vents blocked or full of dust? Are the fans working?