There is three things that could be happening:
1. A program or driver in the background is causing a fatal error which
causes a reboot. You can go to system properties, advanced, startup and
recovery and uncheck the restart on fatal error. The next time you encounter
a fatal error the computer will not reboot it will show you a blue screen
which could give some indication of what program or driver is causing the
problem.
2.Your computer is overheating causing the CPU to reboot.
3. You have a virus. Run a virus scan off the internet to see if it picks up
anything. Sometimes a virus can also effect the virus scan program installed
on your computer so that it does not detect viruses properly.