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