On PC you need to either click the button in the top left of the lobby to open the friends tab up.
From here you can click on the party status that should say public.
If it’s set to public then people will be able to join your session.
So, you’ll need to change it from public to private.
Now people will need to be invited to the lobby in order to join.
When you reboot the game, it will stay on the same settings as you left it. So if you are wondering why people cannot join the next time you start the game it will be because it’s still set to private and not public.