It sounds like you are referring when the operating system goes to sleep mode, and turns off the monitor and disables some features that use too much battery (including wi-fi).
You can go into the sleep settings of your computer, and make the delay bigger, or check for any other setting that might help.