It is everyone's nightmare that their PC suddenly keeps rebooting itself for no apparent reason, however it is a very common issue faced by lots of people and you're not alone. In this article I will list down the most common causes among the hundreds, if not thousands of possible factors that can cause this issue.
I decided to write this guide because I had the same problem yesterday, when I almost went all out to buy a new PC, before I decided to go online and do some research. The cost spent to fix my PC is just a mere 5USD item, which I will reveal later at the end of the article.
Lets get started then :)
1) It might be a spyware, a virus that causes your PC to restart. Run a thorough Virus scan.
2) Check for any new software/drivers that you installed with new hardware which may cause instability to your system.
3) Last resort, format your PC and do a clean install of Windows (of course backup your important files beforehand). I'm serious. This is the only way to make sure it is not caused by software. With a clean setup, if your PC is still rebooting, proceed to Hardware causes below :)
1) First thing you should try, which solves 80% of all PC auto reboot problems, is to reseat your RAM. Ground yourself, pull out your RAM, wipe off any dust and plug it back in. This will be the first thing they will ask you to do when you call the help support line.
2) Next one is pretty obvious but often neglected, open your PC casing, power it on and make sure all the fans are running (chassis fan, back fan, CPU fan, power supply fan, graphic card fan etc.) Loosen cables might cause an immobilized fan which leads to overheat problems.
3) Overheating. If this is the cause, you should be glad that your PC is auto rebooting because this means that the thermal protection system is working. When your PC detects an overheat (most likely the CPU or graphics card) it powers down itself before any damage is done.
Fix the airflow of your system - Clean off all the dust from the fan to your CPU heat sink, make sure airflow is good from where air goes in all the way to where it goes out. You'll be surprised how much dusts are collected over the years.
This step are not meant for the fainted heart, as it involves removing the CPU heat sink which is irreversible. Only attempt this as a last resort. This is also the root cause for my case, where I unscrewed and removed the CPU heat sink from my CPU, and found that the thermal paste on the contact surface between my CPU and heat sink are worn out and almost non-existence. Read more about thermal paste here. Basically it is the gel like compound which is applied between your CPU metal surface and CPU heat sink, so that there's no air trapped in between, therefore allowing heat to easily transfer from your CPU to your heat sink. I spent 5USD to buy some good thermal paste and applied myself, after that my PC never reboots again because my CPU doesn't overheat anymore.
4) It could be your memory problem, Google some memory testing software (e.g. http://www.memtest.org/) and run it to see if it detects any problems.
5) If you have some very powerful hardware (graphics card especially) but weak power supply, it might cause reboots too because it couldn't supply enough power. Getting a more powerful power supply might solve the issue if you recently purchased a new power hungry hardware.
If it is non of the above, it might be caused by faulty hardware. Up till this point there's nothing much you can do but to borrow different pieces of hardware from friend and replace them one by one to see which solves it. If all else fails, it might be a faulty motherboard because it is the most complicated hardware on your system. Check out with some technicians before you make the decision.
Good luck, let me know in the comments if you managed to solve your problem (with or without the tips from this guide), as your problem might be someone else's problem too :)