1st you connect an Apple TV or an AirPort Express router to your wifi system. When the iPhone or iPad detects the Apple TV or AirPort Express the AirPlay icon will show on your device when playing music or video (not from the Camera Roll).
It might be obvious, but it took me a while to find out that I have to swipe twice to the left after dobble klick the Home button to find Airplay on my iPhone.