As of April 2011, Verizon Wireless and AT&T are the only two U.S. mobile providers to sell and provide support for the iPhone. AT&T iPhones use GSM technology, which requires you to insert a removable "SIM" card into the device in order to use it. SIM cards associate your iPhone with its network -- but as an added security measure, AT&T sells iPhones "locked" to its network, so inserting your own SIM card into an iPhone may or may not work.
When you purchase an iPhone from AT&T, you usually also sign up for a one- or two-year service contract, which prohibits you from cancelling your AT&T service without paying a termination fee. Another measure the carrier takes to ensure customer loyalty is sell its iPhones "locked" to its network. What this means is that if you insert a different carrier's SIM card into the iPhone, it will not work on that carrier's network.
AT&T SIM Cards
If you're currently an AT&T customer using another device, you'll be able to use your SIM card in an iPhone. Your SIM card allows your phone to identify your phone number, so you make -- and receive -- calls using the same number you had on your other device. If you enabled your previous phone to store them, you may also have contacts stored on your SIM card, which transfer to your iPhone.
One way to use any carrier's SIM card in an iPhone -- but an unofficial one neither AT&T nor Apple encourage or sponsor -- is to "jailbreak" or unlock your iPhone. Several means for jailbreaking are possible including downloadable, self-guided applications and a number of repair specialists. It's important to understand that while jailbreaking your iPhone allows you increased freedom of use, doing so voids your Apple warranty, meaning that if you incur any damage to your advice, you'll have to pay out-of-pocket to fix it.
Buying Jailbroken iPhones
If you don't currently own an iPhone, one way to use your SIM card inside an iPhone you purchase is by getting the phone from a third party already unlocked. iPhones sold independent of Apple and AT&T don't come with manufacturer's warranties anyway, so the phone being unlocked has little significance in that regard. Keep in mind, however, that your carrier may or may not offer technical support for the iPhone in the event that you encounter problems upon or after inserting your SIM card.