Setting a sleep timer
You can set iPhone to stop playing music or videos after a period of time.
Set a sleep timer: In the Clock app, tap Timer, then flick to set the number of hours and minutes.
Tap When Timer Ends and choose Sleep iPod, tap Set, then tap Start to start the timer.
When the timer ends, iPhone stops playing music or video, closes any other open app, and then