To lock a team you must be team admin. Follow the below instructions
Start in the Team π tab
Select Settings
Scroll down to Team Privacy
You will see Team is unlocked > press the βοΈ icon beside it
Choose to lock the team
No new members will be able to join the team
You can always unlock the team at any stage, by navigating to the same location and choosing unlock.