The U.S. House of Representatives narrowly passed a bill on Tuesday night that will allow Americans to legally "unlock" their cell phones once their original plan expires, allowing them to bounce between carriers. So theoretically, if you had an iPhone 5s on AT&T but wanted to switch over to T-Mobile once your contract expired, you could do just that, no questions asked.
A few points worth mentioning. It's unclear if the Unlocking Consumer Choice and Wireless Competition Act, H.R. 1123, has a shot of passing the Senate. (GovTrack says it has about a 74% chance of passing, but, you know, Congress.) And at the last minute, several key Democrats ended up opposing the bill due to a change in the text by Republicans: Last-minute language made it illegal for businesses to "bulk unlock" mobile phones. "The last-minute change that was made in this bill… puts a real poison pill in this bill for consumer advocates such as myself," Rep. Jared Polis (D-Colo.) told the Hill. "Many consumers won't be unlocking their phones themselves. There needs to be a market in unlocked phones."
It wasn't always that way. In the past, consumers were able to unlock their phones thanks to a provision in the Digital Millennium Copyright Act, but the Library of Congress's Copyright Office declined to extend it. That means right now it is technically illegal to unlock any phone purchased after January 27, 2013.
Carriers like Verizon Wireless, AT&T, and Sprint Corp. have typically locked devices to keep their customers from jumping to competitors, offering expensive phones (say, $600 unsubsidized) at subsidized prices with a two-year contract ($200ish). T-Mobile and its "Uncarrier" platform, however, are challenging that model, with some success.