A nice way to have it turn off (even after you are asleep) is to set a timer.
1. You will need to go into your clock app.
2. Set the desired time (I have 45 minutes)
3. Select When Timer Ends
4. Scroll to the bottom of the screen and select Stop Playing and then Set (upper right of screen)
5. Select Start
I have also included an embedded 2 GIFS followed YouTube video below with instructions.