Unlocking your phone for t-mobile is super easy nowadays.
I got it done in less than 30 mins.
First, you wanna back up your phone in case anything should happen to it while you jailbreak/unlock the phone.
I did mine on a freshly restored phone so it took less time.
After you're sure you wanna unlock your phone, you have to jailbreak the device first. As long as the firmware is still at 3.1.3 or 4.0.1 or below, jailbreaking is as easy as going to jailbreakme.com on your phone's browser while connected to the internet (and plugged in to power), and slide the button to the right and let the device jailbreak itself.
When you're done with that, Cydia will automatically be installed on your phone. Open up cydia and let it refresh itself. Select user interface. Go into Manage, then Sources. Click on Edit, then Add. Add: repo666.ultrasn0w.com. (With a zero, without the period at the end)
When that's done, go into search and download ultrasn0w. Install that, confirm the install. Restart your phone and congrats, it's unlocked.
Good luck!