Welcome to the Apple Community.
Basic AirPlay: Assuming both devices are on the same network and that AirPlay is not turned off on the Apple TV, then simply tap on the screen when you are watching content you wish to stream to your Apple TV, then tap the airplay icon that appears in the control bar, choose the Apple TV from the menu that appears.
Mirroring: When displaying the content you wish to mirror on the iPad 2 (or better), iPad Mini, iPhone 4S (or better), swipe from the bottom of the screen, tap the AirPlay icon and choose your Apple TV from the list of devices (iOS 7 or better) or double tap the home button (quickly) and swipe the bottom row of apps to the right to reveal the playback controls, tap the AirPlay icon and select your Apple TV from the list of available devices (pre-iOS7)
AirPlay ports on your router need to be available/open. Other folks having problems with Home Sharing recently have teh same types of issues, but AirPlay uses a couple of different ports (I think) than Home Sharing. If you are using a router other than an Apple AirPort Extreme, you may need to get into your router and make sure these ports are open, aside from Winston's suggestions if those don't work. But try his list first. Here is a link to Apple's common hardware/software port requirements for routers. Home this helps.
The standard router configuration on most routers should allow AirPlay without the need to go opening or forwarding ports. That doesn't mean to say it won't be necessary in every case, but it's not the sort of thing to go fiddling with first.