Unlocking an iPhone allows the user to switch simcards.If the mobile is locked with any particular network then the mobile will work with only that network.It needs to be unlocked wherein the network restriction will be removed.If this is done one can change networks as they like.To test whether the iPhone is unlocked try inserting various simcards with the iPhone 4 and if it works then there the mobile is unlocked.If the iPhone shows any error messages like "Invalid sim" "Sim inserted incorrect" then the mobile is locked still.Providers like Simpleunlocking.com unlock an iPhone 4 using their remote unlock service and remove the network lock permanently.

Unlocking means that you're able to insert and use the Sim card from another mobile carrier, and use their network. It's used when traveling overseas when you can't use the phones bought where you live. Thus you can't 'tell' unless you try to connect to another phone service, which would include setting up a new service contract with another network and trying to connect to them.