You can find out if your iPhone is unlocked by going to Settings > General > About. If "No SIM restrictions" appears next to Carrier Lock, your iPhone is unlocked.
You can find out if your iPhone is locked by going to Settings > General > About. If "SIM locked" appears next to Carrier Lock, your iPhone is locked to the phones current cellular carrier.
Android
Yes, you can check if your Android device is locked to your current cell carrier by going to your phone's Settings and looking for Network & Internet, Connections, or a similar option. Then, select Network Operators or Mobile Networks. If you can search for and select different network operators, your phone is likely unlocked. If only one carrier shows up, your phone is probably locked to that carrier.