yes, but you need to unlock it first. No as in phone password unlock, but as unlock it so that your iphone can use any carrier. There are many sites where you can find simple instructions. Contact me if you need any assistance because I have done the same thing you need to do for my friend.
Hi no problem first check whether your iphone is locked to at&t network or not .If it locked then unlock it at Mobile-unlocker.com and then use it on t-mobile network .Here in this site they help you unlock your iphone using remote unlocking method .If it unlocked then it will freely accept your t-mobile sim in it .