Bovine mastitis is a common inflammatory disease, mainly induced by bacterial pathogens, such as Staphylococcus aureus, Escherichia coli, and Streptococcus agalactiae. Mastitis has negative effects on the production and quality of milk, resulting in huge economic losses. Melatonin, which is synthesized and secreted by the pineal gland and other organs, is ubiquitous throughout nature and has different effects on different tissues. Melatonin is crucial in modulating oxidative stress, immune responses, and cell autophagy and apoptosis, via receptor-mediated or receptor-independent signaling pathways. The potent antioxidative and anti-inflammatory activities of melatonin and its metabolites suggest that melatonin can be used to treat various infections. This article reviews the potential for melatonin to alleviate bovine mastitis through its pleiotropic effect on reducing oxidative stress, inhibiting pro-inflammatory cytokines, and regulating the activation of NF-κB, STATs, and their cascade reactions. Therefore, it is promising that melatonin supplementation may be an alternative to antibiotics for the treatment of bovine mastitis.