Why does Apple TV not stop my Mac from sleeping?
You might want to try going to 


System Preferences
Energy Saver
Then set Display Sleep to never


If you find the need to put the display to sleep because you want to have the computer on and running for whatever reason then I would suggest going to the Screen Saver options and enabling Hot Corners. In that screen you can make the display go to sleep or trigger a screen saver by moving the mouse cursor to a corner on your screen.

Source: That is my current setup. No Display Sleep on unless I'm running a lengthy Time Machine Backup overnight.