You can use the Timer function of the Clock app for iOS as a sleep timer. Go to Clock app and tap on the Timer tab. Setup the “hours” and “min” and tap “When Timer Ends”. Scroll all the way to the bottom and select “Stop Playing”.
You have now setup a sleep timer for any app. Play the Music, YouTube, movies or run any game/app, and it will be stopped when the timer ends.