If your phone uses a SIM card, you can set a lock on the card so that it cannot be used by anyone who does not know the lock code. This is nothing new and it remains tied to your SIM card and not your phone. Easily lock or unlock SIM card on Android. Enter settings by tapping menu > settings > location & security > Set SIM card lock. You can turn the setting on or off by simply checking the box.

Fair warning: you may have to get the default SIM pin from your carrier and too many attempts can and will mess with your SIM.