I think I solved this. I recently bought a computer with Windows 11 preinstalled, so going back to Windows 10 wasn't an option for me. What's happening is, after 45 minutes, the computer automatically switches to hibernation. I noticed it because I stopped playing a game to have some food and watch a show and, while I was watching the show, my LEDs all turned back on and then, after a moment, turned back off. When I went to wake up the computer, it acted like it had been shut down, as hibernation does. It took some digging, but I found the cause of this. There's a setting that makes this happen hidden in the "Control" program. To fix this, this is what I did:
-Windows key + R and run "control"
-Hardware and Sound > Power Options
-Next to whichever plan you have selected: Change plan settings >Change advanced power settings
-Click on the plus sign next to "Sleep" on the list of stuff that comes up
-On the sub-list, click on "Hibernate after"
-It's set to 45 minutes, change it to Never
I did this and then successfully had my computer on sleep for close to 2 hours without it switching to hibernation. There's also a setting on that for "Turn off hard disk after" and it's automatically set to 20 minutes. I don't know if that makes a difference, but I changed mine to Never. I don't like some person who programs this OS thinking they know better than me when my computer should do things like sleep, hibernate and shut down. I pay my electric bill, I'll decide when I want power saving to kick in.