Windows will restart automatically for a couple of different reasons:
1) Your software update settings might be configured to automatically install updates, in which case it will reboot to finish them. This support document from Microsoft details how to configure the settings: http://support.microsoft.com/kb/306525
2) When Windows crashes, there is a setting that will automatically restart the system so the user is spared the Blue Screen of Death (BSOD). A quick google turned up this link, http://www.trishtech.com/winxp/disable_automatic_restart.php, but there are many others just like it.
3) As for preventing yourself from rebooting the computer manually, there is a way to set up a "Group Policy" with restrictive security settings. You can learn more here: http://www.addictivetips.com/windows-tips/how-to-disable-remove-shutdown-from-windows-xp-and-vista/, but I would recommend against this as it is not a trivial thing to configure AND why would you want to lock yourself out of your own computer?
Anyway, hope these links help and good luck!