Touch Screen timeout and select the time of inactivity before your phone sleeps.
Use Attentive Display to keep the screen on when you're looking at it and turn it off when you look away:
In certain lighting conditions, your phone may have difficulty detecting when you've looked away.
To turn Attentive Display on:
Go to Settings > Display > Screen timeout.
Or, open the Moto app and tap 
If you don't want to use Attentive Display, then turn it off 