Wait a second, Ill give you the answer for this. Is the computer totally shutting off? or just restarting?
If shutting down........
1. possible virus
2. power supply
if restarting......
1. possible virus
2. failure with power supply
3. cpu is becoming faulty
4. memory (RAM) is becoming faulty
5. hard drive clicked the machine. I dont know what this is called, but its happened to me. Your doing normal work, then suddenly the hard drive stops, restarts, and so does the computer.
6. overheating problem (highly unlikely)
My Solutions!
Use AdAware, and Norton Systemworks. These are the best two programs to make sure your computer is running fine. If that doesnt fix it, take it to a technician, or someone who feels safe in checking internal components.