Additionally, another reason for this problem is the divided settings options present in Windows. Some settings are present in the Settings app, some are present in Control Panel, while others have to be changed from the Registry app.

Change Screen Saver Settings

This is the most common solution or workaround for this problem.

Change Sign-in settings

In the event that the above solution does not work, you can set the computer to always require sign-in. This solution is a more proper solution than the previous one. In general, many people do not have to change this setting. However, if the previous solution did not work then you may have to change your sign-in settings. In order to do so

Change Registry Settings

This solution is for the tech-savvy. However, it is still recommended to proceed with caution as changing unknown registry settings may cause issues. A reason presented by Windows users is that registry applications may have been changed by any application and could cause issues such as Windows not locking. Therefore, it is suggested to proceed with caution in this solution. To change the registry settings

Fix: Windows 10 Shuts Down Instead of SleepFIX: Screen Goes to Sleep/Off By Itself on Windows 10How to Fix Mouse Zooming Instead of Scrolling on Windows 10?How to Make Windows 10 Shut Down Instead of Hibernating (hiberfil.sys)  SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 34 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 19 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 8 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 52 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 33 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 22 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 88 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 89 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 68 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 31 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 57 SOLVED  Windows Goes to Sleep Mode Instead of Locking Screen - 37