No. While your PC is in sleep mode or turned off the Windows operating system no more stay awake and hence the alarm won't work in either of the situations.