Does OpenSUSE's encryption work when the computer is asleep?

I am going off of this article which describes encrypting the file system on OpenSUSE. However, it is unclear as to whether this encryption simply unlocks when the computer is booted up, or whether it is based on normal user login. I am probably not being very clear here, so in a hypothetical situation: if my laptop were to be stolen while it was asleep and not shut down, would this encryption protect my data or not?

It depends on what you are doing. It is possible to just have an encrypted home directory, in which case it is unlocked when you login. It is also possible to encrypt important file systems, in which case it is unlocked during boot.

Currently, I use an encrypted LVM, which is unlocked at boot. If my laptop went to sleep mode, it would still be unlocked. So best not to do that unless the computer is in a secure location.

Thank you for the clarification. But if I were to hibernate my computer instead of sleeping then root encryption would work because hibernation passes through the bootloader - correct?

Yes, that’s right. But best to check whether hibernation actually works. Whether it works may depend on the hardware and may depend on whether you are using UEFI secure-boot.

I should add that if you are planning to hibernate, then you should make sure that swap is also encrypted. The hibernation image is saved to swap, and this is insecure if not encrypted.