Teams can be set to public or private. When set to private only members you have invited to the Team will have access to conversations, files, and the SharePoint site created with a Team.
If your Team is set to Public, anyone with a correct license can access your conversations, and files with the SharePoint address.
To change your team from a public site to a private site, or vice versa:
Go to your Teams tab in the Microsoft Teams application (this is not available in the mobile version).
Click on the ellipses next to the name of your team and choose 'Edit team'
Select the privacy level you would like your team set to and click on Update at the bottom of the page to update these permissions.