there are couple of reason why computer reboots automatically. As I've read that its a feature of windows to shut itself down to avoid bigger problem.
1. corrupted/outdated system files. Windows update, assuming you've PC.
2. incompatible device's drivers. Manufacturer's support page is the best however there are driver tool that do this thing fast and effectively like this one: http://xpdrivers.com/index.cfm
3. faulty hardware. RAM, video card, HDD. There are tools for that. memtest for RAM, manufacturer's tool for video card and chkdsk /f for HDD.
hope it helps.