The main function of the iCloud lock and Find my iPhone Activation Lock features are to make impossible the theft of an iPhone device because when these features are enabled it is almost impossible to erase the credentials and start using the device.
But this feature can also have reverse effect because the users can lock out themselves if they forget their login information or if someone buys a used iPhone from an owner who did not remove his login info. There are two methods to solve this issue. First is by Apple iCloud removal service and the second one is by using bypass iCloud lock.
If your iPhone is locked on iCloud you can contact Apple to help you Bypass iCloud Lock and execute iCloud activation lock removal. But remember that if you decide to use Apple’s services for this problem you will have to have the original receipt with you along with your original Apple ID and take them o an Apple store, but if you don’t have it they won’t even look at it. Also you can try and use the Apple’s online customer support service for the exact same reason. But do not use this method if you do not have the required receipt and Apple ID.