You will need OSX Mountain Lion or later on your Mac.
Make sure your Mac and your Apple TV are connected to the same Wi-Fi network.
When both your Mac and your TV are awake, choose your TV from the AirPlay Status menus (icon) in the menu bar. You can use the same menu to:
- Mirror your Mac display or use your TV as a separate display that extends your desktop.
- Turn off Airplay. Pressing the Menu button on the Apple TV remote also turns off AirPlay.