In Windows 7, click on Start then right click on Computer and choose the option ‘Properties' from the menu. In the Properties window, choose the option Advanced system settings from the menu on the left hand side. In the new window that pops-up, choose the tab Advanced and click on the button Settings under the option Startup and Recovery. Again a new window would pop-up; uncheck the box next to ‘Automatically restart' that you will find under System failure.
In Windows 8/8.1/10, press Windows key + X then click on Control Panel from the menu. In Control Panel choose System Maintenance and System. In System, click on Advanced System Settings and choose the Advanced tab. In Advanced tab click on Settings button which is under Startup and Recovery. In the new windows unselect the check box next to Automatically Restart that you will find under System failure.
Also the Windows Memory Diagnostic can be run to check on the issue. Click on the "Start" button and then click on "Memory".