Hello vansh40,
Just to confirm, is Always on Display enabled on your device? If so, the Always On Display feature allows a dimmed version of your Lock Screen to stay visible, even when your iPhone is locked.
Please check out this link, which has more information about that, and options to lock the device, which may be helpful: Keep the iPhone display on longer
Change when iPhone automatically locks
You can set how long it takes iPhone to automatically lock.
Go to Settings
> Display & Brightness > Auto-Lock, then choose a length of time.
Keep your Lock Screen visible with Always On Display
On iPhone 14 Pro, iPhone 14 Pro Max, iPhone 15 Pro, and iPhone 15 Pro Max, the Always On Display setting allows a dimmed version of your Lock Screen to stay visible, even when your iPhone is locked. By glancing at the dimmed screen, you can check essential information, like alerts, the date and time, and information in your widgets.
The display automatically turns off when iPhone is 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.
The Always On Display setting is on by default. To turn it off, go to Settings
> Display & Brightness, then turn off Always On Display.
Tip: When Always On Display is turned on, you can choose whether to show your wallpaper or notifications on your Lock Screen. In Settings > Display & Brightness > Always On Display, turn Show Wallpaper or Show Notifications on or off.
Thanks!