iPhone
Yes, it will. However, note that you will still have to unlock it to turn off the alarm. If you do not want to have to unlock the device before stopping the alarm in the morning, we recommend keeping the device unlocked.
Android
Yes, Sleep Cycle will work if you lock the screen. You will not have to unlock it when the alarm goes off.