Does iPhone have to be jailbroken to work with T-Mobile service?

My friend is letting me buy his iPhone 4 from him and I have T-Mobile as my phone service. He has At&t, which means it's possible to make it work with T-Mobile since both use sim cards. I was just wondering if the iPhone needs to be jailbroken in order to unlock it in order to work with my T-Mobile sim card or is there another form of unlocking to make it work.
I wouldn't really want it to be jailbroken because I remember jailbreaking my iPod Touch a while ago and it completely messed it up eventually.

Also, where can I take it to unlock it? Do I have to do it myself or can I take it to a T-Mobile store? I don't know if it's against some rule to do this.

You can get a Permanent Unlock and use it on T-Moblie.
http://attiphoneunlocker.com/faq/

You can safely update the OS on your handset at any time, and sync your device with your computer without fear of Apple removing your unlock
We provide an AT&T Official, Permanent, Apple unlock that remove any network restrictions your iPhone may have by marking your handset as unlocked in Apple's IMEI database.
Once your Unlock has been processed just follow these simple steps:

1) Open iTunes on your Mac or PC (verify you have internet connectivity).

2) Connect your iPhone to your computer using the USB data cable.

3) Backup and Restore your iPhone using iTunes.

4) Once your iPhone is restored it will have the Factory Unlock in place!

http://attiphoneunlocker.com/

No problem mate.nothing to worry. You can definitely unlock an iPhone 4 without jailbreaking. You can unlock an iPhone 4 safer and easier using remote unlocking service. You can get the remote unlocking service for an iPhone 4 from http://www.simpleunlocking.com/apple-iphone-4/rs16wp9/ at low cost. Once you have unlocked it you can start using with your T-mobile SIM card. As i said earlier this method of unlocking doesn't require a jailbreak.
Here are the steps for unlocking an iPhone 4,
1. Wait for to send you an email saying your phone has been activated or remotely unlocked.
2. Install the latest version of iTunes.
3. Make sure your Apple iPhone 4 phone software is updated to the latest version using the iTunes software.
4. Connect your Apple iPhone 4 to iTunes with a NOT ACCEPTED SIM card.
5. Wait until iTunes detects your Apple iPhone 4.
6. Disconnect your Apple iPhone 4 and reconnect it after 10 seconds.
7. Your Apple iPhone 4 is now unlocked.

You can unlock your iphone from att here
http://www.vunlock.com/

  • Will Simple Mobile card work for tracfone service? I want to get my tracfone service on my iphone 4s and i can't seem to find a sim card that is sold in stores, but i did find a simple mobile sim card will this work? It is also an At&T iphone i'm using
  • Will a AT&T sim/service work in/on my t-mobile iPhone 5? AT&T has recently opened their prepaid plans up to iPhones now and I have read a lot that AT&T iPhone 5 will work on t-mobiles service, however I want the exact opposite. I need to know if my t-mobile iPhone 5 can/will work on AT&T service?
  • Virgin Mobile iphone 4s: Does it work on T-mobile? If I purchased the unlocked iphone 4s from Virigin mobile would I be able to use it on T-mobile? Does anybody know if the virigin mobile iphone has a spot for a sim card like the ones T-mobile uses?
  • My iphone says no service. I have family mobile? I've done everything, powered down took out sim card everything, still not working. And i just payed my bill on the march 30th, i went on familymobile.com and it says my phone is activated.