1) You got virus. Blaster virus is a famous one.
2) Overheating of devices. It could be the processor heatsink is
not attached properly, the power supply fan is failing, the fan is
failing. It could be other devices that are working so hard so that
it generates so much heat that it overheats and it forces a
shutdown. Make sure that the area around your computer is clean,
because dust can trap heat as well.
3) You sit too close to the CPU and hit the restart button. Quite
rare, but could be a possibility.
4) Overclocking. If you overclock, and yet did not take enough
prevention, it can cause overheating and result in restarts.
5) Hard disk failure. If your hard disk is a few years old now, it
could be nearing death. Back up your files and buy a new hard
disk.