Next-generation passive optical network (PON) has been considered in the past few years as a cost-effective broadband access technology. With the ever-increasing power saving concern, energy efficiency has been an important issue in its operations. In this paper, we propose a novel sleep-time sizing and scheduling framework for the implementation of green bandwidth allocation (GBA) in TDMA-PONs. The proposed framework leverages the batch-mode transmission feature of GBA to minimize the overhead due to frequent ONU on-off transitions. The optimal sleeping time sequence of each ONU is determined in every cycle without violating the maximum delay requirement. With multiple ONUs possibly accessing the shared media simultaneously, a collision may occur. To address this problem, we propose a new sleep-time sizing mechanism, namely Sort-And-Shift (SAS), in which the ONUs are sorted according to their expected transmission start times, and their sleep times are shifted to resolve any possible collision while ensuring maximum energy saving. Results show the effectiveness of the proposed framework and highlight the merits of our solutions.