You are referring to the PIN, which is sometimes called a passcode. A 4 digit number.
I have never used it to access my online account.
It is used as a way of authenticating my account in a store or online if upgrading, making inquiries or making account changes.
When I ported from another carrier my PIN from that carrier was required to port my numbers.
For security, you can change the PIN after using it in a store. The default is the account owners last 4 of social security. We are advised to change that to another number these days.