have a look in control panel/event viewer under the system and application tabs for any errors listed. note the dates and times.
to stop the computer restarting and instead get an error displayed click:
start/control panel/system/advanced/start up and recovery/settings
untick 'automatically restart'
next time it crashes you will see an error displayed, note this down exactly and look it up via the 'search (Kb)' box click here