Do you have a lock screen set, or do you have it set to None?
If you have it set to PIN, Pattern, Password or Fingerprint, how long a time do you have it set to? (If it's set to 10 minutes, it won't lock until 10 minutes after the screen turns off.) (If it's set to None or Swipe, there's no time setting. If None, it never locks, if Swipe, it has to be swiped if the screen was off even for a second.)