I have not read through all 35 pages on here, so I imagine that there are different problems requiring different solutions. This will not fix everyone's issues, but hope that it will make a positive contribution to the discussion here. I work in IT and was assisting a client today with this issue:
Client has a Windows 7 Home Premium SP1 64-bit desktop (i7 920 CPU, 12 GB of RAM) with iTunes 10.5.1 installed on the machine. This is the computer hosting the iTunes library (videos, music, etc.) to the other devices on the network (Apple TV, iPads, and iPhones). The devices are able to see the library, but intermittently lose the ability to see the iTunes library on the desktop. For this client, Home Sharing was working perfectly prior to updating to iTunes 10.5 (for the iOS 5 update). However, closing / re-opening iTunes on the desktop restores access, but only temporarily.
iTunes is updated to the newest version (10.5.1). Apple TV is updated to the newest version (4.4.3). All iOS devices are updated to the newest version (5.0.1).
Client had contacted AppleCare - they replaced the Apple TV free of charge and attempted troubleshooting the issue with the client, but were not able to provide a resolution for them.
Client replaced their router with a new Apple AirPort Extreme. This did not resolve the issue for them. However, other users have reported a resolution by switching/upgrading their router.
The power settings on the desktop were set to 'Never' go to sleep or hibernate.
All applicable Services on the machine were turned on.
For Apple TV users, the issue persisted whether it was hard-wired or using the wireless radio.
I have seen several posts stating that ports need to be opened up. The Apple support site for the Apple TV states the ports the device uses for automatically updating the time on the device and for Home Sharing. You will have two conditions where this can potentially be a cause of an issue (ports being blocked):
1. You own a security appliance (i.e. SonicWALL, Cisco, etc.). This family of networking devices are primarily used in a business setting and start at around $500. Most residential users are using routers that will not restrict traffic within the internal network. In most cases, you should have not have to make a change in the router's firmware for Home Sharing to work properly.
2. You have third-party security software installed on your computer. Certain security products will contain an anti-virus component and a firewall component. Any security product labeled "Internet Security" (i.e. Norton Internet Security) will come with a firewall component. The ports are listed so that you can create custom rules for the software firewall installed on your computer if it is blocking the ability to share over the network. An easy way to determine if this is the problem would be to temporarily disable the anti-virus and firewall.
The client had Microsoft Security Essentials installed on the machine and was using the standard Windows Firewall. I checked the rules for Windows Firewall and saw that it was configured correctly - set to allow iTunes traffic. This was a longshot, but I disabled it anyway as it was the last variable that I could think of at the moment to provide a resolution for the client. This restored all functionality. I had three simultaneous streams of different video from the desktop to an Apple TV, iPad, and iPhone.