1. Go to settings > display.
2. Select "sleep" after how much ever time you want.
3. Go to settings> security
4. Select the screen lock, as password/ pattern
5. The phone will automatically lock after the given amount of time
Hope this helped.
Sent from my A11 using xda app-developers app