Try the following steps, check whether things are working after each step where appropriate, before trying the next.
- Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
- Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
- Restart the Apple TV (Settings > General > Restart).
- Restart the Apple TV by removing ALL the cables for 30 seconds.
- Restart your router. (Also try removing it’s power cord for at least 30 seconds)
- Restart your mobile device or computer.
If you are still having problems, try using 802.11n for wifi if you are currently using either 802.11b or 802.11g.
You might also try removing any other software related to screen sharing or streaming to remote displays that you might have installed at some time.
If your problem is AirPlaying from a computer, try disabling bluetooth
If you are still having problems, the following article(s) may help you.
Troubleshooting AirPlay
Troubleshooting Wi-Fi networks and connections
Recommended Wi-Fi settings
Wifi Diagnostic Software (for Mac users)
You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.