Setting up Home Sharing in iTunes on your computer
Open iTunes on your computer.
Choose Advanced > Turn On Home Sharing.
Enter your Apple ID and password that you use for the iTunes Store, then click Create Home Share.
To share personal photos with Apple TV (2nd generation) choose Advanced > Choose Photos to Share.... and enable the option to share photos. For more information, read this article.
Repeat steps 1 through 4 on each computer you want to use for Home Sharing.
Tip: Be sure to enter the same Apple ID and password on each computer you intend to use for Home Sharing.
Setting up Home Sharing on Apple TV (2nd generation)
On Apple TV, choose Computers > Turn On Home Sharing.
Enter the same Apple ID and password you entered on your computer(s) and choose Done.
Once Home Sharing has been turned on, Apple TV will automatically find iTunes libraries on your home network that have Home Sharing turned on using the account name you entered. The shared libraries will appear in Computers on the main menu of Apple TV.