Sleep problems are commonly reported during opioid agonist treatment (OAT) for opioid use disorders. Inpatient studies have found both sleep disturbances and improved sleep during OAT. Illicit opioids can also disrupt sleep, but it is unclear how they affect sleep in outpatients receiving OAT. Therefore, we used electronic diary entries and actigraphy to measure sleep duration and timing in opioid-dependent participants (n = 37) treated with methadone (n = 15) or buprenorphine (n = 22). For 16 weeks, participants were assigned to attend our clinic under different operating hours in a crossover design: Early hours (07:00–09:00) vs. Late hours (12:00–13:00) for 4 weeks each in randomized order, followed for all participants by our Standard clinic hours (07:00–11:30) for 8 weeks. Throughout, participants made daily electronic diary self-reports of their sleep upon waking; they also wore a wrist actigraph for 6 nights in each of the three clinic-hour conditions. Drug use was assessed by thrice-weekly urinalysis. In linear mixed models controlling for other sleep-relevant factors, sleep duration and timing differed by drug use and by clinic hours. Compared to when non-using, participants slept less, went to bed later, and woke later when using illicit opioids and/or both illicit opioids and cocaine. Participants slept less and woke earlier when assigned to the Early hours. These findings highlight the role OAT clinic schedules can play in structuring the sleep/wake cycles of OAT patients and clarify some of the circumstances under which OAT patients experience sleep disruption in daily life.