WiFi, by default will shut itself down after so long if not in use - so connecting permanently will need you to change the power setting.
Go into control panel and open up your device manager, hardware manager or whatever your version of windows is calling it - find your wifi adaptor and right click it and select properties. Now you should have lots of tabs, like General, Advanced, About, Driver etc etc - click on the Power Management tab, and you should see some tick options. There should be an option for 'Allow the computer to turn off this device to save power' - make sure that is unchecked, then your wifi should stay connected.

Health, Ammo, and bacon and eggs!
