Have a look at Nest's community forum. As LaPastenague and Bob have mentioned above, Nest has a long history of issues with network communication (going back before Google acquired them). Issues have been reported in connecting to WiFi routers / access points, connectivity to the Nest server (even when the WiFi connection is solid), and battery drain (using power to communicate faster than it can recharge - if you don't have a 'C' wire).
I recommend trying to determine if you are actually losing the WiFi connection or if the WiFi is fine and it is an issue between the thermostat and the Nest server. If you see an Offline status in the app, go into Airport Utility, hold down the option key, and double-click on the device to which the Nest is supposed to connect. See if the Nest shows up in the client list (you need to know the IP and/or MAC address). If it does, then it is more likely an end-to-end (Nest server connectivity) issue. If it repairs itself temporarily after a thermostat restart (or you can just disconnect and reconnect to the WiFi) that is another clue that points to server connectivity.
I spent months taking network traces, identifying issues, and giving all of the info to Nest. Some of the bugs are just dumbfounding, like the thermostat not renewing its DHCP lease when it expires (hence the need for a DHCP reservation). When one of my thermostats crashed on a cold day and it was clear that the same thing could happen when I wasn't home, I realized they weren't ready for prime time and put my tried-and-true basic programmable thermostats back on the walls.
One of the Nest recommendations for users who don't have a C wire is to modify the beacon interval and DTIM settings (wireless stuff) for the SSID on which the thermostat connects. You can't do this on any of the Apple products (default to 100ms and 3 like a lot of other routers). If you have a C wire, that shouldn't matter. I never had any local connectivity issues between the thermostat and an Airport Express.