Have you checked the Energy Saver settings in System Preferences? It's probably set to go to sleep after 15 minutes of idle time. I usually set it to Never and enable the screensaver from the Displays pane in System PReferences. But that's entirely up to you.