Some analysis of the problem will be needed (otherwise we're left to guess). Wireless hardware (chipset and driver) details might be useful to start with. Open a terminal and do
Code:
/sbin/lspci -knn | grep -i net -A3
Also, you could monitor the NetworkManager logging, and capture the output when your wireless connection stops working. I'm not an Ubuntu user, but I think 16.04 is using systemd, so try monitoring in a terminal window like this
Code:
sudo journalctl -fu NetworkManager
Report back with the relevant output when your connection drops.
It may well be a power management issue.