"The display automatically turns off when iPhone is either face down or obstructed from view, not near a paired Apple Watch, when a CarPlay session begins, while Continuity Camera is in use, while Low Power Mode is on, while Sleep Focus is on, or at your usual bedtime."
On iPhone, you can set the display to stay on longer.
support.apple.com