Windows Phone 8.1 by default doesn’t have password lock enabled. What this means is whenever the screen times out, it doesn’t need any password to get back in.
Here is how to set it :
Go to Settings > System and choose “Lock Screen”.
Turn the slider to “On” for “Password”. Also, tap on “Require a password after” to set time interval for this lock.
Choose the appropriate time interval (each time, every 30 seconds, 1 minute, 5 minutes and so on) after which the screen gets automatically locked and would need a password to unlock.
The screen lock now will be active and need a password to unlock.
Happy locking.