Some more details would help.
How are you connected to the Internet? dial-up, braodband modem directly to your PC, through a LAN, through a router?
What is your hardware, and be specific.
Are you using any P2P applications at the same time? Kazaa, WinMx, Piolet, mIRC, usenet groups, eDoneky, eMule or anything similar when this happens?
As a guess, you have an inactivity or hibernation setting for the hardware device to the internet, and you should check in Control Panel, Power Options, to disable this. You should also check through Device Manager, Network Adapters, your network adapter, Configure, Advanced, to make sure there is no inactivity time-out value set.
Finally, you should check with your ISP. Many disconnect an inactive connection after a period that ranges from 12 minutes to 2 hours. Please tell use what ISP you use, and what the Plan is for service.