Melatonin (MT) is a key regulator in plants’ response to leaf senescence induced by aging or various abiotic stresses. Here, we demonstrated that darkness and leaf aging enhance endogenous MT levels by upregulating key genes involved in MT synthesis. Additionally, exogenous MT application significantly mitigated leaf senescence induced by darkness and leaf aging in tomato plants, leading to higher chlorophyll content and maximum photochemical efficiency (Fv/Fm) compared to the control. Using Solanum lycopersicum L. tryptophan decarboxylase (SlTDC)-overexpressed and -knockout transgenic tomato seedlings, we found that SlTDC overexpression increased endogenous MT content and suppressed mRNA levels of chlorophyll degradation-related genes: pheophorbide a oxygenase (PAO), pheophytinase (PPH), and non-yellow coloring1 like (NOL). Furthermore, SlTDC overexpression alleviated photosystem II complex (PSII) photoinhibition, increased ribulose-1,5-bisphosphate carboxylase (Rubisco) and Rubisco activase (RCA) activities and mRNA levels, and maintained higher photosynthetic efficiency in leaves under darkness and in leaves aged over 35 d compared to wild-type plants. Conversely, SlTDC knockout accelerated darkness- or leaf aging-induced leaf senescence in tomatoes. Our findings suggest that MT application or SlTDC overexpression can effectively alleviate leaf senescence by regulating photosynthesis in tomato plants.