The Clock app for iPhone and iPad doesn't just tell time, it keeps track of it. The Timer lets you to keep track of important intervals from cooking to exercising, from a few minutes to several hours. Simply set it and wait for it to go off. This iTip from 3uTools is about how to set a shutdown time on your iPhone 6/iPhone 7
Launch the Clock app from your Home screen. Tap on the Timer tab. It's the button in the bottom right corner of your screen.
Tap on the When Timer Ends button. You need to calculate and set the time when you want to turn off your iPhone/iPad automatically.
Then scroll through the list and tap on the sound you want. Find "Stop Playing" and Click "Set" button on this page. As below: