Troubleshooting guide
How to fix the problem
In Windows 11, go to Settings > System > Power & battery or Power to display and sleep times; In Windows 10, they are usually Power and Sleep. Choose times for battery and power adapter separately. Screen off, sleep and lid close action are different settings; Do not store a covered operating laptop in a bag.
If the problem persists
Check individual times with battery and power adapter. If the computer goes to sleep after closing the lid, check its behavior in the power options; keep the device uncovered on a hard surface.
Request a repair