Apple provides free parental controls for iPhone.
https://support.apple.com/en-us/HT201304
There are multiple apps like TimeLock and time limits to restrict how much screen time your child can use.
At at some point you will have to go old school and take phones if the break the night time rules.