Postmenopausal women have a significantly increased risk of cardiovascular disease and osteoporosis due to the lack of estrogen protection. To explore the effects of melatonin on clock genes and glucose and lipid metabolic disorders of postmenopausal women, the models of ovariectomized (OVX) mice under different dietary conditions were generated and given melatonin gavage for 8 weeks. Biochemical indexes of serum and the morphology and histology of livers of the mice were checked. Transcriptome analysis, qPCR and Western blot were used to detect the expressional levels of genes related to clock and glucose and lipid metabolism in the livers of mice. The intestinal microbiota of the ovariectomized mice under different dietary conditions was further analyzed with 16S rDNA sequences. Melatonin significantly reduced the high concentrations of TC and LDL-C in the serum and lipid accumulation in the livers of the ovariectomized mice, and downregulated the protein expression associated with cholesterol and fatty acid biosynthesis, including HMGCR, FDPS, IDI1, MVK, LSS, FASN, and ACC. Melatonin could also improve the insulin resistance of the ovariectomized mice, upregulate the protein expression levels of p-IRS1, p-AKT, and p-mTOR, and reduce the protein expression level of p-Glycogen Synthase under high-fat diet (HFD) conditions. In addition, melatonin restored the clock genes expression disturbances caused by ovarian removal or high-fat diets, and upregulated the expression of the core circadian clock genes Clock and Bmal1. Melatonin also effectively increased the abundance of beneficial bacteria, improved the structure of microflora, and reduced the harmful bacteria of the ovariectomized mice fed with HFD. These results suggest that melatonin could affect liver clock genes expression and gut microbiota in ovariectomized mice, and improve glucose and lipid metabolic disorders under different dietary conditions.