You can go to Settings > realme Lab > Sleeping Capsules and click the + icon in the upper right corner to add a time period.
You can set From, Duration (1-6 hours), and Repeat (if you do not select the days, it will only take effect once).
Related Articles:
What is Sleep Capsule and how to use it?
The sleep capsule grayed out and cannot be set