AT&T will provide you with the steps to unlock the handset but you must already be past your initial contract period, or pay the early termination fee now.
Why would such limited conditions apply? Because from AT&T’s point of view, they gave you a discount on this latest-greatest piece of hardware in exchange for a contract for a couple years of service.
Why would you want to unlock your iPhone 4 or 4S? So you can use a Cellular Abroad prepaid micro SIM card from the local overseas phone company and save big on your really fun vacation overseas this summer, of course!
Check out more about unlocking the AT&T iPhone on this page from website The Verge, http://www.theverge.com/2012/4/9/2935666/how-to-unlock-att-iphone-instructions