The circadian rhythm, called Process C, regulates a wide range of biological processes in humans including sleep, metabolism, body temperature, and hormone secretion. Light is the dominant synchronizer of the circadian rhythm—it has been used to regulate the circadian phase to cope with jet-lag, shift work, and sleep disorder. The homeostatic oscillation of the sleep drive is called Process S. Process C and Process S together determine the sleep-wake cycle in what is known as the two-process model. This paper addresses the regulation of both Process C and Process S by scheduling light exposure and sleep based on numerical simulations of circadian rhythm and sleep mathematical models. This is a significant step beyond the existing literature that only considers the entrainment of Process C. Regulation of the two-process model poses several unique features and challenges: 1. Process S is non-smooth, i.e., the homeostatic dynamics are different in the sleep and wake regimes; 2. Light only indirectly affects Process S through Process C; 3. Light does not affect Process C during sleep. We consider two scenarios: optimizing light intensity as the control input with spontaneous (i.e., unscheduled) sleep/wake times and jointly optimizing the light intensity and the sleep/wake times, which allows limited delayed sleep and early waking as part of the decision variables. We solve the time-optimal entrainment problem for the two-process model for both scenarios using an extension of the gradient descent algorithm to non-smooth systems. To illustrate the efficacy of our time-optimal entrainment strategies, we consider two common use cases: transmeridian travelers and shift workers. For transmeridian travelers, joint optimization of the two-process model avoids the unrealistic long wake duration when only Process C is considered. The entrainment time also decreases when both the light input and the sleep schedule are optimized compared to when only the light input is optimized. For shift workers, we show that the entrainment time is significantly shortened by optimizing the night shift working light.