The settings for Wi-Fi and Wi-Fi Hotspot are slightly different, if I am not mistaken (if you have created multiple profiles, you have to go to the Owner Profile to change the settings).
1.) Wi-Fi: as described here, this can be turned off automatically with a timer via settings>Network & Internet> Internet> Network preferences>Turn off Wifi automatically> x minutes
2.) Wi-Fi hotspot: settings>Network & Internet> Hotspot & tethering> Wi-Fi hotspot> turn off hotspot automatically.
If you have set up a hotspot with your GrapheneOS device and your iPhone is connected to it, the hotspot should not be deactivated automatically, as the setting "turn off hotspot automatically" only applies if no device is connected to it.
What I unfortunately cannot answer for sure and cannot test right now is whether the setting "1.)... turn off Wi-Fi.... x minutes" leads to a Wi-Fi hotspot simply being switched off, even though another device is connected to it.