Spotify desktop app doesn't turn off Windows sleep mode, as a result when you're playing music on your PC and aren't working on it, the music will be stopped when the computers goes to sleep.
I wanted to stop this behavior as the Spotify devs doesn't handle this functionality asked for years by users (even if multiple tickets are posted in their Ideas Community Website).
Here is an app that will analyze if Spotify is running and playing music, if so, it will prevent Windows from sleeping.
Windows installer and app description here: http://nicolasconstant.github.io/Spotify-Sleep-Mode-Stopper/
Once installed, just launch the app, it will automatically check the Spotify status.