You can temporarily turn off power saving by manually typing: iw wlpXsX set power_save off
where wlpXsX
is the name of the interface.
You can permanently turn off power saving by creating a file: /etc/NetworkManager/conf.d/wifi-powersave-off.conf with the following contents:
[connection]
# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).
wifi.powersave = 2
I haven't found a way to turn it on on battery and off on AC, but in my case, it doesn't make a perceivable difference to the battery drain, so I keep it off.