You need to go into the Display settings and look at Sleep mode/timeout or something similar. You can set the duration that your laptop will wait before going to sleep.
Assuming that you're using Windows 11, click the 'Start' Button and select 'Settings'.
Then select 'Power & Battery'. Under 'Power', select 'Screen & Sleep'. Change the four settings there to meet your own preferences. (I've got the 'plugged in' settings showing 'Never', which I suggest is what you might also choose. The 'battery power' ones will depend upon how you use your laptop and how long you want the battery to last).