Best way to tell if your phone is unlocked or not is the put the t-mobile sim card in it and see if it works. If it doesn't work then it's likely a locked iphone.
Where did you purchase your phone? Did you purchase your phone under contract or off-contract (subsidized or full price respectively)? If it's under contract from AT&T, then it is permanently locked to AT&T.