There are several companies that sell unlock codes for Apple's iPhone, such as MyIMEIUnlock.com. In addition, some network providers unlock a customer's existing phone for a fee when the customer joins the network.
MyIMEIUnlock.com does not require users to jailbreak their phones in order to unlock them. Prices for the service vary by location and carrier.
In addition to using unlock codes, owners of jailbroken iOS devices can unlock their phones using a free app called Ultrasn0w. IClarified.com provides instructions for using this app and for jailbreaking iPhones. As of 2015, this app supports iPhone devices running any version of iOS up to 7.1.2.