This works well for videos and photos. But what about your music or all your other Apps or Games. Well if you have an iPhone 4S, you are in luck. You can use the mirroring feature to view your screen as it is on the iPhone directly on your TV.
Requirements: iPhone 4S, Apple TV, wireless network on which both the devices are connected.
To turn on mirroring in the iPhone, double press the home button. Swipe the multitasking bar left twice. You will see this screen.
The round button with a blue image in the middle is the AirPlay button. Touch it. You will be presented with the Airplay choices. If you have multiple Apple TVs at home on the same wireless network, they will all show up.
Note that although I say wireless network, the apple tv can actually be wired to an ethernet port. If the Apple TV has previously been on the wireless network, that is good enough.
Select your Apple TV, and slide the Mirroring switch to the on position. Now everything you see on your iPhone will show up on your TV as well.
When Airplay mirroring is on the status bar will become blue and the AirPlay logo will show up on the status bar like so.
This works on iPhone 4S and later and on iPad 2 and later models.