As of January 26, 2013, it's illegal in the US to unlock your phone without your mobile carrier's permission. Unlocking your cell phone means you can use it on any wireless provider, but it's useful for more than just switching carriers. If you want to sell your used phone to someone else or travel internationally with your cell phone and avoid hefty data roaming fees, you'll want to unlock your phone.
The Digital Millennium Copyright Act (DCMA) had an exemption that permitted cell phone unlocking, but the Library of Congress and US Copyright Office have let that exemption expire...which means unlocking your phone is now a crime--even after their contracts have expired, subject to fines of $200 to $2,500 or higher criminal penalties including jail time. The full legal docket is here and ITworld has a nice overview of the issues here.
As with jailbreaking and rooting, unlocking your phone gives you more control over it. I personally think that this unlocking ban is terrible for mobile users, especially global travelers. If you agree, join this petition to make unlocking cell phones legal. We need 100,000 signatures by February 23.
(By the way, in the news you might see writers saying that unlocking/jailbreaking is now illegal, but the two terms are actually very different. Unlocking is different from jailbreaking and rooting--here's how.)