To lock the keypad in the standby mode, press the center Navi (scroll) key and then the * key. To unlock, press the same keys.
For QWERTY devices the lock / unlock sequence is Navi key followed by the Fn key (the key showing an arrow in the lower left corner of the keypad).
You can also set the keypad to lock automatically after a time-out, select Menu > Settings > Phone (or Phone settings or Device) > Automatic keyguard > On, enter the time you want and select OK.
Note: When the keypad lock is on, calls may be possible to the official emergency number programmed into your device.