To unlock an iPhone, contact the service provider that you bought the phone from and ask them to unlock it; the phone guides you through the rest process when you insert a new SIM card. Customers have to meet certain requirements to have their phone unlocked.
The process for unlocking an iPhone can take a few days. Have the phone's IMEI handy before calling, as the carrier uses this number to identify the phone. Carrier's subsidize the cost of smartphones, including iPhones. Because of this, most lock the phone to their networks to ensure that customers stay long enough for the provider to recoup their subsidy. AT&T, for example, only unlocks phones for customers who are in good standing and who have been with AT&T for at least two months. Other carriers have differing requirements, but customers who have completed a contract typically qualify for an unlock.
Before switching to a new service provider, it's important to ensure that the phone is compatible. In the United States, Verizon and Sprint use CDMA networks, while AT&T and T-Mobile use GSM technology. However, a Verizon CDMA phone might not work with the frequencies required for Sprint service. LTE technology further complicates matters, as phones might not support the right LTE channels.