Background. The NLRP3 inflammasome is overactivated in the brains of APP/PS1 transgenic mice and AD patients, and mitophagy has an obvious negative regulatory role on NLRP3 inflammasome activation. The protective effect of melatonin in AD may be related to the regulation of mitophagy and NLRP3 inflammasome activity. TFEB plays a critical role in maintaining autophagy/mitophagy. Studies have found that TFEB plays a protective role in AD. Methods. APP/PS1 transgenic mice were given melatonin in their drinking water for 3 months. Compared with mice without melatonin treatment, the mice given melatonin showed changes in the following features: (1) cognitive function, (2) mitophagy-related proteins in the brain, (3) ROS, (4) NLRP3 inflammasome and related proteins and the concentrations of inflammatory cytokines, and (5) Aβ deposition. In in vitro experiments, effects of melatonin on mitophagy, NLRP3 inflammasome activity, and TFEB in SH-SY5Y cells with Aβ25-35 were observed. TFEB knockdown was implemented in combination with Aβ25-35 and melatonin treatment, and the expressions of TFEB, Parkin, p62, IL-1β, caspase-1, ROS, and IL-18 were explored. Results. Melatonin improved cognitive function in APP/PS1 transgenic mice and decreased ROS and senile plaques. Melatonin promoted mitophagy in SH-SY5Y cells with Aβ25-35 and APP/PS1 transgenic mice. NLRP3 inflammasome activity was inhibited, and the concentrations of IL-18 and IL-1βwere clearly reduced. Compared with C57/BL6J mice, the amount of TFEB in the brain nucleus of APP/PS1 transgenic mice was decreased. Melatonin treatment increased the nuclear translocation of TFEB in SH-SY5Y cells. TFEB knockout was implemented in combination with Aβ25-35 and MT treatment; the expressions of Parkin, p62, caspase-1, IL-1β, IL-18, and ROS were accelerated. Conclusions. Melatonin promotes mitophagy by inducing TFEB nuclear translocation, downregulates NLRP3 inflammasome activation, and exerts protective effects in SH-SY5Y cells and APP/PS1 transgenic mice.