Phones sold by carriers directly are generally "SIM-locked" to that carrier's network. But you can have it unlocked, subject to terms of your carrier contract. Contact the carrier customer service, or go into a local store, to see if you're entitled to unlock it (usually depends upon how many months you've been under contract, or if the contract minimum term has been completed).
If you paid full price for the iPhone from the carrier, it may already be SIM-unlocked. You can find out by plugging it into your computer and running iTunes with a new carrier's SIM card installed. iTunes will take through the process of activating it with the new SIM card.