It is not something you can program. Contained in the link at the top of this page, which likely brought you here is the following:
About background measurements
The Blood Oxygen app on your Apple Watch will occasionally measure your blood oxygen levels if background measurements are on. This will usually happen when you are not moving. Depending on how active you are, the number of readings collected each day and the time between these readings will vary. Blood oxygen measurements use a bright red light that shines against your wrist, so it may be more visible in dark environments. If you find the light distracting, you can turn off background measurements.
- Open the Settings app on your Apple Watch.
- Tap Blood Oxygen, then turn off In Sleep Focus and In Theater Mode.
Blood oxygen measurements only occur during sleep if the Track Sleep with Apple Watch setting is turned on.