Without knowing your iPhone model and carrier , i can only tell you a general price. Each carrier has a different price tag for unlocking some do it for free some charge a little fee.If you know the original owner name, your original lock carrier sim etc you are in luck and you can get it unlocked for FREE
If you do not know the information mentioned above in that case you can use third party services to get it unlocked. You can get your iPhone unlocked also known as Carrier Unlock or Sim-Free for a very little fee of $12 - $24, which is peanuts.
Lets assume you bought a second hand iPhone and some how it had an iCloud Lock. In that case you use a third party unlocking service which can help you in Unlocking your iCloud Lock.
Open iPhone IMEI and submit your unlocking request. it does cost around $56
How to Unlock iCloud Lock
Step 1 : Open site mentioned above
Step 2 : Select iPhone Model
Step 3 : Enter IMEI
Step 4 : Submit Request and finalize payment details
Your iPhone will be unlocked in 3 working days.