System Power Settings
A lot of systems are by default configured to go into power saving mode after being idle for some time. Make sure that your Power Saving options are turned off with the Power & Sleep settings in your Control Panel:
In additional settings:
Advanced power settings:
Network Interface Controller Power Settings
Apart from the general system power saving options, your network controller may also be configured to turn off after some time to save power. To make sure this does not happen, follow the steps below:
1. Open the Control Panel.
Open “Network and Sharing Center”
Go to “Change adapter settings”
Right-click on the icon for the Ethernet (NIC) card (e.g, Realtek RTL8139...) and select Properties
Click the tab for “Power Management”
Uncheck the box that says “Allow the computer to turn off this device to save power”
Click OK and close out of all open windows.
This will save your settings and prevent your Network Card from disconnecting you from the internet while AFK.
Screensavers, both in-game and on Windows, not to mention Sleep Mode and Hibernate, can interfere with your computer's connection, so it's a good idea to disable these options as well.