If your system has booted into the operating system when this happens, consider starting up into safe mode (repeatedly press F8 when the computer starts or check your computer's manual). From here, run virus scans to ensure it's not caused by a virus. If it isn't, then do a system restore and hopefully this will solve the problem.
If it doesn't solve the problem - or if your computer restart s/turns off before the operating system loads - it might be a hardware problem (in this case, possibly with your power supply unit or system fans). If so, look into getting the computer repaired as necessary.