You can enable in the settings menu the option to set a sleep timer. The player itself turns off playback at a given time. Just enable the
The sleep time setting appears in the menu.
You can see how this works in this audio template:
Interval version of the sleep timer
You can change the sleep timer to an interval view in the advanced menu settings in the extended PRO version of the builder.
In this case, the user will be able to select the number of minutes in the menu when the player goes to sleep.