Several things can be causing this.
1. Windows Update is telling you update. To solve this problem, turn off automatic updates or fully-update.
2. Screen saver is coming on while you are playing. Solution is to turn off screen saver.
3. You are getting some sort of system message that is switching you out of your active game window and to the default message. Find out what that message is and disable it.
4. Maybe y ou are accidentally tabbing out of the window. To do this, you might try running in windowed mode if that is at all possible.
5. For any number of reasons, your computer has found it necessary to restart and is prompting you to do so. If this is the case, do it.
I would take a look at what all is running in your status bar and see if any of that is causing that. You can RUN MSCONFIG to disable these items, but BE CAREFUL!
Hope this helps.