How to know if i have an unlocked iphone 4S?

I want to upgrade to ios 6, i'm using 5.1.1 right now. I'm using my iPhone 4S on T-mobile and I'm not using a gevey sim or anything. I don't want to upgrade and then find out I can't use my phone anymore.

If you need th check the lock status of your iPhone 4S, You can visit http://www.wickedunlock.com/apple-iphone-4s/rs11wp9/ and get the Apple network and lock info service. This will provide you the lock status of your current iPhone 4S. All the best mate.
If you already have an unlocked iPhone, It would get relocked while upgrading your iOS. You need to unlock it again. You can also get your iPhone 4S unlocked here through remote unlocking method from here at affordable cost with easy unlocking instructions. You need not jailbreak your iPhone 4S to unlock through this method.

Your phone is not unlocked. Only AT&T unlocks phones and only if your contract is up and your account in good standing.

If you update to ios6 backup in itunes manually beforehand. Updating WILL wipe the phone.

Well you are using it on T-Mobile which is not an official carrier so chances are it is unlocked now & of course upgrading will kill that.
If it is a factory unlocked then you would be fine no matter what. Only Apple sells factory unlocked iPhones.