you possibly need to get a carrier unlock. what iphone is it? if it's old enough, i believe you could contact at&t and
1. if you used to have at&t before, tell them you want to unlock your iphone and that it's out of contract. they'll ask you for your iphone's imei number and your email
2. if you bought if off of someone from craigslist or something, tell them you bought it off of someone and that you wish to request for it to be unlocked. they should help you unlock it if it's out of contract
if that doesn't work, you can try buying a "official" unlock from ebay. i'm not sure if that still works or they still sell it since i heard about unlocking devices without the consent of the carrier is going to be illegal. i am not aware when that law goes into effect though.