There are many benefits of having your phone unlocked, mainly because you can use the same handset for another service provider, and switch over to better deals. A lot of people loose out by being lazy and keep renewing their contracts with the locked network. Thats how mobile phone networks make money.
As soon as you have completed your contract duration with your service provider you are entitled to get your phone unlocked by them. You can give them a call and tell them to do so, or you can take your phone to a local phone shop and get it unlocked by paying a small charge, for example Carphone Warehouse charges 10 to 20 pounds per unlocking depending on the network restrictions.