Upgrading your iPhone to iOS 5.1.1 through iTunes will update your baseband, potential removing or ruining your chances for an unlock. Please follow this tutorial on how to update to iOS 5.1.1 using a custom ipsw if you need an unlock. The jailbreak is also tethered which means you will need to connect your device to the computer each time you reboot. Finally, it may be prudent to save your SHSH Blobs by following this tutorial before continuing.

If you want to jailbreak a lower firmware version you can find the appropriate tutorial here. If you are on iOS 5.1 and want to stay on that firmware you can still use these instructions by performing the same steps with the iOS 5.1 firmware.

Step One
Create a folder on your desktop called Pwnage

Download the latest version of RedSn0w from here and place it in the Pwnage folder. Likewise, download the 5.1.1 firmware from here and place it in the Pwnage folder. (Note: you do not need to download the 5.1.1 firmware if you are already on iOS 5.1.1)

Extract the RedSn0w zip file by double clicking it.
Click here to enlarge

Step Two: (You can skip this step if iOS 5.1.1 is already installed on your device)
Connect your iPhone to the computer and launch iTunes.
Click here to enlarge

Select your iPhone from the list of devices on the left. Now hold down Shift and click the Restore button. Restore is preferred as it wont create any wasted space on your iPhone.
Click here to enlarge

Navigate to the Pwnage folder on your desktop and select the 5.1.1 firmware ipsw. Click the Choose button to continue.
Click here to enlarge

iTunes will now update your iPhone to the new firmware.

Step Three
Launch the redsn0w application from the redsn0w folder we extracted earlier. You can do this by right clicking the executable and selecting Run as Administrator contextual menu.
Click here to enlarge

Click here to enlarge

Step Four
Once RedSn0w opens click the Jailbreak button
Click here to enlarge

Step Five
Plug your iPhone into the computer and make sure its OFF then click the Next button
Click here to enlarge

Step Six
RedSn0w will now guide you through the steps to get into DFU mode.
Click here to enlarge

Hold down both the Home button and the Power button for 10 seconds.
Click here to enlarge

Release the Power button and continue holding the Home button until RedSn0w detects the device.
Click here to enlarge

Step Seven
Your iPhone will now be exploited with limera1n and reboot
Click here to enlargeClick here to enlarge

Step Eight
RedSn0w will now prepare the jailbreak data.
Click here to enlarge

Step Nine
Select Cydia from the list of options and click Next.
Click here to enlarge

Step Ten
Your iPhone will now be rebooted again and RedSn0w will begin uploading the new RAM Disk and Kernel.
Click here to enlargeClick here to enlarge

Step Eleven
Once this is complete you will be notified that RedSn0w is done. When your iPhone finishes rebooting (5 minutes or so) it will be jailbroken with Cydia on the SpringBoard.
Click here to enlarge

Click here to enlarge


BOOT TETHERED
Once you have jailbroken you will need to rerun redsn0w to boot tethered.

Step One
From the main RedSn0w menu click the Extras button.
Click here to enlarge

Step Two
Select Just boot from the Extras menu to just boot tethered.
Click here to enlarge

*As usual a big thanks to the iPhone Dev-Team and Geohot for their hard work and contribution to the iPhone community.

All software here http://www.gfhost.net/iphone/index.htm