Though they're often discussed in the same breath, jailbreaking an iPhone and unlocking one are not the same thing. They're related - especially in that they give users more control over their iPhone (or iPod touch or iPad; all three kinds devices can be jailbroken. The iPad can also be unlocked.) - but they're not the same.
So, what's the difference between unlocking and jailbreaking an iPhone?
The basic difference is that jailbreaking is about controlling what software you can install on your iPhone (or other iOS device), while unlocking allows you to choose what mobile phone carrier the device will work with.
Under normal circumstances, Apple tightly controls what software can be installed on iOS device: only approved apps offered through the App Store are allowed. But there's a whole universe of apps available through other means. These apps aren't available at the App Store due to Apple rejecting them for various reasons (violating terms of service, competing with Apple's own apps, sometimes poor code or security problems, etc.).
Jailbreaking - which can be accomplished using various tools including JailbreakMe.com - allows you to remove Apple's restrictions on what software you can install on your iPhone, thus allowing you access not only to the App Store, but all the other compatible apps as well (many of these can be purchased via Cydia, the leading alternative app store).
Another way that Apple controls the iPhone (and 3G version of the iPad) is by limiting the phone carriers that it works with. In the U.S., for instance, the iPhone is only officially sold and supported on AT&T. Unlocking allows you to change the carrier that the phone works on.
This requires that the iPhone is compatible with your carrier of choice and that you've got service on that carrier. Unlocked also iPhones don't get all features of iPhones on official carriers (Visual Voicemail is one notable feature that can only be used on official iPhone carriers, thanks to Apple products being present in those carriers' network to support it).
Still, with an unlocked iPhone, you have more choice and may be able to pay less for your service or get better coverage.
So, while unlocking and jailbreaking an iPhone aren't the same thing, they both have the same result: giving the user more control over their iPhone, iPad, or iPod touch.