When you get a new phone through a carrier that requires a special plan or promotional deal, the phone will most likely be carrier locked. Carrier lock means the phone can only be used with a specific carrier until certain requirements are met, such as paying off the device or keeping service active for a set amount of time.
You can check if your iPhone is carrier locked by going to:
Settings → General → About
Then scroll down to the “Carrier Lock” section. It should say either:
• “No SIM restrictions” (unlocked)
• Or the name/status of the carrier lock

A carrier-locked phone cannot legally be unlocked unless it is done through the carrier itself. Most carriers will unlock a phone once it has been fully paid off and meets their unlock requirements.