Prevent iPhone use after hours
You are in control. It is your responsibility.
Here are some suggestions you could try:

To help you keeping focus try a 'Stay focussed' app like Forest (which tries to convince you not to use your phone while the app is running).
To create a threshold you can enable restrictions. Go to Settings -&gt; General -&gt; Restrictions.
Shutdown your phone. The boot time will keep you from using your phone.
Edit settings in your router, some router can set internet access restrictions for certain devices during specified hours.