You can easily lock apps on your iPhone by using Screen Time. Go to Settings → Screen Time → App Limits → Add Limit, choose the app, set a time limit (like 1 minute), and enable the passcode. Once time runs out, the app locks until you enter the Screen Time passcode.