I listen to music every night before going to bed, but I need the music to stop playing so my battery doesn’t drain needlessly. Fortunately, there is a free and easy way to have my music not play all night for free with the stock apps bundled in iOS. Lets walk through doing this on the iPhone (though it works on the iPod touch and iPad too).
First, choose the album or playlist you want to listen to in the Music app.
Next, go to the Clock app and choose the Timer section. Set when you want the music to stop playing (1 hour, 2 hours, etc.).
When that is complete, choose “When Timer Ends”. Go all the way to the bottom and choose “Stop Playing.”
Finally, hit the “Start” button. The timer will begin counting down.
These steps are quick and easy to set up. It’s too bad that a sleep timer isn’t built into the Music app, but for now this is the next best option.