Welcome to AndroidCentral Thanks for the question.
If you look under Settings -> Security. There is a setting there called "Automatically lock". This is basically a timer for how quickly the phone is locked. So if it's set for 10 minutes, then it won't show up immediately.