On an iPhone or iPad, you can turn off AirPlay from the app you're streaming by tapping the AirPlay icon and selecting "Turn ...
To lock apps on your iPad, you can set its Screen Time feature for limiting app usage to passcode-protect apps, and customize ...