If it comes back on immediately, it may be a physical problem with the
hardware related to the power supply (contacts on power switch or a short
of some kind). Luckily these problems are rare and it is more likely that
this is a regular shutdown problem. See the shutdown troubleshooting guide
for XP here: http://www.aumha.org/win5/a/shtdwnxp.htm
If the system powers down and restarts hours later, check setting in BIOS
setup screens for "Wake On..." features. Examples: Wake on LAN, Wake on
Ring, Wake on RTC