In many metazoans, final adult size depends on the growth rate and the duration of the growth period, two parameters influenced by nutritional cues. We demonstrate that, in Drosophila, nutrition modifies the timing of development by acting on the prothoracic gland (PG), which secretes the molting hormone ecdysone. When activity of the Target of Rapamycin (TOR), a core component of the nutrient-responsive pathway, is reduced in the PG, the ecdysone peak that marks the end of larval development is abrogated. This extends the duration of growth and increases animal size. Conversely, the developmental delay caused by nutritional restriction is reversed by activating TOR solely in PG cells. Finally, nutrition acts on the PG during a restricted time window near the end of larval development that coincides with the commitment to pupariation. In conclusion, the PG uses TOR signaling to couple nutritional input with ecdysone production and developmental timing.