As of February 11th, 2015, a new law was put into effect. This law states that carriers are now required to unlock the customers device per request.
You can unlock your phone by contacting your wireless service provider to find out when and how your phone may be unlocked. Most phones can be unlocked by a software update or an unlock code provided by the carrier.
Participating providers will unlock postpaid mobile wireless devices for customers or former customers in good standing after fulfillment of the applicable service contract or device installment plan, or payment of an early termination fee.
For devices purchased for prepaid wireless service, participating providers will unlock devices within one year of initial activation, consistent with the provider's reasonable time, payment, or usage requirements.
If you are no longer a customer of the service provider or the phone/account has not been in good standing, there are other options to perform an unlock. The most common approach outside of calling the service provide is to use a 3rd party unlocking service. These companies can be located by search on Craigslist or Ebay. The cost for this service tends to run anywhere from $20 up to $50. Please be cautious if you intend to use one of these organization.
If you have an unlocked phone then take a look at these Bring Your Own Phone (BYO) wireless plans to switch to a new carrier.
You can refine these further by selecting which carrier your phone is currently with when you land on the search page