When you purchase any phone which is “in contract” with your carrier. This means that your phone is locked with that specific carrier. Locked period for a phone can vary anywhere from 1 to 3 years and it mostly depends on how much money you pay up front to purchase that phone. The less money you put down, the longer your lock in period will be, generally speaking.

There are however instances, where your phone may not be unlocked by these 3rd party services. Unlockers find creative ways to find new methods to unlock your phone. But sometimes restrictions are such that some phones may not be unlocked. For instance, Softbank in Japan is one network for which its currently not possible to get factory unlock. Unlock for Nokia Lumia is another network for which success rate is about 60 to 70% as of this writing if your phone is “under contract” with AT&T network.
This situation can be temporary because new methods are being tested and introduced on weekly basis so its entirely possible that next week, there may be a solution available to factory unlock these “in contract” phones.

Buying new “in contract” phone:

When you buy a new phone, one of the considerations should be how easy it is to unlock a phone with the network that you will be locked to. Each country will have different costs and unlock times associated with unlocking a given phone. For example in the US, its most cost effective to unlock a phone with AT&T network. T-Mobile on the other hand may be the most expensive and take the longest. Currently unlocking an iPhone on AT&T network with Clean IMEI will cost $40 to $60 and will be done within 7 to 10 days. Unlocking that same iPhone on the T-Mobile network will cost upwards of $150 and may take upto 25 days. So it may be that the cost to acquire the phone with T-Mobile is a little cheaper but the cost and time required to unlock that phone later may not be worth the money ou save up front.

Buying used “in contract” phone:

When buying an in contract phone, make sure the amount you pay for the phone takes into consideration the money and time required to unlock that phone. Also note that there are some phones for which there is less of a chance that the phone may be unlocked. As mentioned earlier, a Nokia Lumia phone locked with AT&T network has about a 70% chance of being unlocked.

When buying a used phone which is out of contract, most like you can get it factory unlock it and use it on any GSM network around the world. So you can pay for it according to market value of that phone at the time of purchase.