These are incredibly complex devices. To compensate for high battery use by these amazing displays (and increasingly complex apps and software), you have myriad options to save power /data in your settings. You can limit background data usage by apps in data usage settings, you can go to device manager and limit connections and app activity while the screen is off (background). It's this where I'd start looking. If you have no battery /data limitations you can go wild and have the device run like a demon. If you limit these activities, then things like your issue happen.
Device management is a place to start to poke around in, power saving mode... Settings... Restrictions.. There you can allow apps that run in background to use WiFi and mobile networks. Key words being background here!
In developer options, there is a swag of settings to make WiFi more aggressive..
In connections, you can find advanced WiFi settings and tweak the WiFi activity.
In the data saver settings you can allow apps to use background data usage (meaning they will keep open the WiFi regardless of screen status)..
Like I said, these are convoluted devices, and a lot of exploring is required to get the most out of them... Pick the apps you want active and allow them to run whenever and you'll be away... Good luck