Nope, that's not quite it. Jailbreaking allows you to install applications and themes that are not blessed by Apple and not available through the App Store. Some of them are free, some aren't. Unlocking allows you to use your phone with any GSM carrier, for example T-Mobile in the USA rather than AT&T.
You can jailbreak without unlocking, but you must jailbreak in order to unlock.
And furthermore you can't unlock even if you are jailbroken if you have upgraded to the latest version of the baseband.