YouTube Premium will get a sleep timer

Have you ever fallen asleep to a YouTube video and then woken up a few hours later with a new video automatically playing? If so, you’ll definitely benefit from the sleep timer that YouTube is now planning to introduce.
Sleep timer.
But for now, the feature will only be available to YouTube Premium subscribers. And it’ll be in test mode until September 2. There’s no guarantee that YouTube will make the feature available to the public based on the results of the test.

If you’re subscribed to Premium and want to test out the sleep timer, follow this page and turn it on. Then, when you open YouTube on your phone or computer, you can go to the settings menu while the video is playing to set the sleep timer to the desired interval after which playback should stop.
Sleep timer is a sleep timer.