The screen recording feature on an iPhone allows you to record your device's screen activity, and the length of time you can record depends on the available storage space on your device.
By default, there is no time limit for screen recordings on an iPhone. However, the longer you record, the larger the file size of the video will become, which may impact the available storage space on your device.
If you're concerned about running out of storage space during a screen recording, you can check your available storage space by going to Settings > General > iPhone Storage. It's also a good idea to periodically transfer or delete any large files to free up space on your device.