Is it simply the screen that goes off (with computer still running), or the whole computer rebooting?
If it's rebooting, it could be something like a broken fan causing the CPU to overheat and shutting itself down.
It's always a good idea to regularly check the fans and clean out all the dust from them so they run properly.
Depending on your setup, it could also be that your system doesn't have enough cooling fans if, for example, you've installed a better graphics card or more hard drives, again causing overheating.