Apple Macbook Pro Retina display turns off automatically
First thing is to try to work out what is causing the screen to power down. Does the console give up any messages when the display shuts off?

If there's nothing showing, try going into the System Preferences, to the Energy Saver settings and disable the sleep mode for both the display and the laptop. It will complain when you do this, and you WILL want to be mindful of it not going to low-energy use esp. when you're on battery power - and see if it stops the issue. (This was a recurrent issue when I updated my first macbook to Snow Leopard, so it can be a glitched software install)

If it does, then you know it is a sleep-related issue that may best be solved with a reinstall of the OS. If not, then your best bet is to find a Certified Apple Service center and have them put a diagnostic test to the hardware.

Good luck!