Click Start -> Right Click on "My Computer" -> Propeties -> Advanced -> Click the third "Settings" button -> Uncheck "Automatically Restart" -> OK
Next time this happens, tell us the error
Also, try going to the system log (Start -> Run -> eventvwr.msc) and see if there are any errors there.