If you find that your Raspberry Pi 3, the new one (at the time of writing anyway!) with built in WiFi and Bluetooth, loses the WiFi connection after a period of inactivity, then this thread on the Raspberry Pi Forums, which will open in a new tab, might be of interest. Have a read. If you want to miss out on the preliminaries of the thread, start reading here instead.
Basically, all you need to do is:
sudo iw dev wlan0 set power_save off
I’m not affected yet, but I’m making a note here, just in case!