Counting back: bedtime = wake time minus the number of cycles times 90 minutes, minus the time it takes to fall asleep. Counting forward: wake time = lights out plus the time to fall asleep, plus the cycles. The 90 minutes is the average cycle length the Sleep Foundation gives, which also says a typical night holds four to six cycles, so the page offers three to six.
A worked example. The alarm is set for 7:00 a.m. and it takes you 15 minutes to drop off. Six cycles are 9 hours, so bed at 9:45 p.m. Five cycles are 7 hours 30 minutes, so 11:15 p.m. Four cycles, 6 hours, means 12:45 a.m.
Check the answer against the hours you need, not only the cycles. Five cycles clear the 7 hours the CDC recommends for adults; four do not. If you want the hours by age instead of cycles, the bedtime calculator works from those. If a run of four-cycle nights has already happened, the sleep debt calculator adds up the shortfall.