1. Using the Apple TV remote, open the Settings app. It's at the top right in the current interface.
2. Go to the AirPlay menu.
3. Choose Set Password.
4. Input your chosen password, then select Submit on the right.
Now when someone tries to AirPlay from their iPad, iPhone, or iPod touch, they will be asked for that password.
When you no longer need it to be password protected, go back to the AirPlay menu and choose Clear Password.