WiFi turns off in Ubuntu 16.04

Ever since I installed Ubuntu on my laptop about 2 weeks ago, the WiFi randomly goes off and the only way (that I've figured) to solve the issue is by restarting my computer.

However, I am getting a bit annoyed with this especially if I'm working on a document or something of that sort. Also, when that happens, the "enable networking" and the "enable wifi" boxes are both checked. I've tried unchecking and rechecking them, but it's still the same anyways.

Any suggestions/solutions?

Edit #1: Result of:

$ lspci -knn | grep Net -A2

02:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection [8086:4222] (rev 02)
    Subsystem: Hewlett-Packard Company PRO/Wireless 3945ABG [Golan] Network Connection [103c:135b]
    Kernel driver in use: iwl3945
    Kernel modules: iwl3945
--
05:08.0 Ethernet controller [0200]: Intel Corporation PRO/100 VE Network Connection [8086:1092] (rev 02)
    Subsystem: Hewlett-Packard Company PRO/100 VE Network Connection [103c:30bb]
    Kernel driver in use: e100
    Kernel modules: e100

You should disable power management. Open terminal by ctrl+alt+t and run following commands one by one

    sudo ifconfig wlan0 down
    sudo iwconfig wlan0 power off
    sudo ifconfig wlan0 up

If it works, make it permanent by putting it into script or through pm-utils.

If that didn't solve your problem than disable n

If you have intel type of wireless card, you might want to try disabling n-wireless.

Hope it helps.