To unlock your iPhone from its carrier, you'll likely need to contact your carrier directly to cancel your contract.
To unlock your phone from Verizon, the phone must be 60 days past its purchase date and not flagged as lost or stolen.
It's not always easy to tell if an Android device is locked to a cellular/wireless provider, but there are methods to retrieve this information. If your device is locked, it will only take SIM cards ...