If a) on WiFi, and b) not being charged, then Apple devices will turn off the WiFi radio pretty quickly (couple of minutes) after the device goes into "screen lock" mode. So, if you want to operate an Apple device on WiFi for an extended period of time, either a) turn off auto-lock, or b) connect to a charger (PC, wall, external battery pack).
WiFi Goes to Sleep
Unlike Android devices, Apple's iOS will disconnect devices relying solely upon a WiFi Internet connection when the "Auto-Lock" timer has expired and disconnected from a charger. If the device has integral Cellular Data and the service is in range, network dependent background applications (e.g. Zello, Skype, TurboVUi) will continue to work even when the screen is locked. However, if out of cell range and relying upon a WiFi connection, the device will disable the WiFi connection once locked, either manually or once the Auto-Lock time has expired.
One band-aid approach to keep the WiFi connection active is to configure the Auto-Lock setting to "Never". This will drain more battery but will keep the WiFi connection active. Note: if you manually "lock" the screen, the WiFi adapter will turn off just as though the Auto-Lock timer were enabled.
Another approach is to use an external battery pack from Jackery or Mophie who makes a combined case with battery pack. When using one of these power sources, the Apple device will operate as though it is being charged and will keep the WiFi connection active even if the screen is locked.
What about my cell coverage?
So now you're probably thinking that I'm usually in cell range so does this really apply? Many times, your device may be in cell range, and it is for phone calls, but data/Internet coverage may be diminished much greater than expected. The problem is not in the device but in the cell provider's network. 4G and LTE coverage expands based upon network traffic. So, if you're at the edge of coverage, your data connection can rapidly deteriorate in an area where it was previously working just fine but your signal indicator may not change at all. For the most part, this is a problem that will get better in time as providers continue to build out / expand their next generation wireless data networks. For now, just be aware that 2 or 3 signal bars doesn't always mean a good data connection. We recommend an app like "speedtest.net" to instantly check availability of your Internet connection and the speeds you can expect.