I've had a few iphones, and am familiar with the unlocking/jailbreaking process to get them to work on T-Mobile. Although, before you jailbreak and unlock, it is wise to do your homework on which firmware and baseband versions you have installed on your device.
So it looks like I have Version 4.3.2 (8H7) for my iOS firmware, and Modem Firmware of 05.16.02. I'll post my research and findings here.
I updated my baseband to a strange version, the iPad baseband 06.15.00, because supposedly that was unlockable -- I have not had any luck yet. It is jailbroken so I can at least use it as a 32GB 'iTouch' on wifi for now.
Update: I ended up using a variety of iphone tools, to end up installing a custom version of iOs 4.1 (8B117). If you are attempting to jailbreak/unlock for the first time -- read up. The amount of knowledge and posts out there is overwhelming, especially as much of it is opinion and personal recommendations....
The utilities you should have handy:
Pen + Paper: write down your phones Version (iOS), Modem Firmware (baseband), Serial number may also come in handy.
iTunes - create a backup of your iphone today. Backup your contacts, anything of importance. Get familiar and comfortable erasing your iphone with an official Apple 'stock' firmware, and then restoring your backups. Firmware can be chosen instead of auto-upgraded to latest and greatest -- learn how to do this (Shift+Restore/Option+Restore). If you upgrade to 'latest + greateast' you could be shutting yourself out from unlocking/jailbreaking...
TinyUmbrella- learn about and create backups with this tool
iClarified - great website for tutorials and stock firmware
iphone-dev.org - learn about and possibly get redsn0w and pwnage, note that versions work well with firmwares from around that timeframes
Archive the utilities and firmware versions you used for later reference and use.