Steps to Turn on Sleep Timer in Spotify
The music will stop playing once the time reaches the set limit. It will help you to turn off music automatically after you go to sleep.
Steps to Add Sleep Timer to Any Music Player App on Android
The app supports many music player apps and has some additional features as well. The Shake Extend feature lets you increase the time by shaking the phone. Doing this will play a notification sound, so you can verify the time is extended.
More on the topic:
How to set Spotify/YouTube Music songs as music alarm on any Android PhoneHow to play music through Google MapsHow to view lyrics on YouTube Music app for Android