How to prevent Pokemon GO from keeping my screen on?

While there is no option to have your phone turn itself off or lock the screen automatically while the app is open, there is a battery saver option in the game. It will have the game turn the screen off while staying open in the background as long as the phone is upside down, and sometimes while the phone is horizontal. It will not prevent your phone from draining the battery and dying, but it will slow down that process.

You can find the battery saver option by clicking on the pokeball icon from the main screen (open world map screen), then clicking the gear icon for settings in the top right corner, and then scrolling down until you find the "Battery Saver" option. Make sure it is checked to enable it.