Perhaps, you could help with figuring out the problem, by answering a few questions. Has the computer always done this? When did it start? Had you installed any software just prior to noticing it restarting itself? Had you made any adjustments or tweaks? When you shut the computer down, (Start, Turn off Computer), do you see a message that a certain program is not responding? When you turn it off definitively, do you have to pull the plug?
Not to alarm you, but one possibility is that a trojan is using the interval of the shutdown time to write itself to the registry to allow itself to be reinstalled at bootup and it is simply causing the machine not to shutdown but to reboot given a certain timeout.