The steps listed may be slightly different based on the Android OS you’re running.
Go to Settings > Security (might be listed as Location & Security) > Set Up Screen Lock. Here you’ll be presented with three choices: Pattern, PIN or Password
Set a PIN Unlock. Unlocking with a PIN means numbers only. You can use just 4 or up to 16 numbers.
The more numbers you use, the harder it will be to crack. If you already have a PIN number you use for other things you may be tempted to apply it to your Android phone as well. It is suggested to add an extra number at the beginning or end for an additional layer of security.
After you've entered your chosen PIN, press Continue and confirm by entering it again. Once you hit OK the PIN is set. At any time before this you can hit Cancel to start over.