Spotify has a sleep timer feature in the mobile app that will automatically turn off your music after a set amount of time.