It depends on what system you’re using.
I don’t know about iOS, but if you’re using Android, you can use the following method (or XML attribute) to keep the screen from fading out:
However, I would not recommend doing that. It’s very bad behavior because the user expects his/her device to automatically turn off (making your app go into a paused state).
Think about what happens if he/she puts the device into some kind of bag or whatever and forgets to actually turn it off while playing your game. The result could be an empty battery if he/she gets the device out at a later point of time.