In order to stop your computer from automatically rebooting in case of a BSOD (BlueScreen Of Death), you have to change a default setting.
- From the desktop right click on My Computer.
- Click the Properties option.
- In the System Properties window click the Advanced tab.
- In Advanced click the Settings button under Startup and Recovery.
- In the Startup and Recovery window uncheck the Automatically restart check box.
- Click Ok.
If you then simply google the hexadecimal number of the STOP code, that'll usually point you in the right direction. In some cases, a more elaborate error message is printed (e.g. IRQL_NOT_LESS_OR_EQUAL), sometimes including a driver's file name (e.g. NV4_DISP.DLL) which is very helpful.
See here for a complete list of STOP codes.