The simplest method is to put in a SIM card of a different carrier. If your phone is able to connect to the network, or it gives you an option to set it up, then it is unlocked. You can also see this in your phone settings (on Android: Network or SIM settings; on iPhone: Settings, General, About Carrier Lock). If you don't know, the carrier will definitely tell you the answer if you give them your phone's IMEI.