Magnesium (Mg) is one of the essential elements for the growth of tea tree and is extremely important for its development. In this study, we investigated the effect of Mg on the transcriptome and physicochemical indexes of tea leaves, and the results showed that Mg could significantly affect the gene expression of tea leaves. The results of Orthogonal Partial Least-Squares Discriminant Analysis (OPLS-DA) model analysis showed that a total of 300 key genes (Variable Importance for the Projection, VIP > 1) were screened under different concentrations of Mg treatment, among which 140 genes were up-regulated and 160 genes were down-regulated. The bubble map was used to screen the characteristic genes from the above key genes, and a total of 121 representative characteristic genes were obtained, mainly involving 9 metabolic pathways. Among them, gene expression of three metabolic pathways, including porphyrin metabolism, alpha-linolenic acid metabolism and photosynthesis, showed an increasing trend with the increase of Mg concentration, while gene expression of four metabolic pathways, including biosynthesis of secondary metabolites, anthocyanin biosynthesis, ABC transporters, pentose and glucuronate interconversions, showed a decreasing trend. The results of physiological index analysis showed that with the increase of Mg concentration, the photosynthetic physiological index, theanine and soluble sugar content of tea leaves showed an increasing trend, while the content of tea polyphenol, flavone and caffeine showed a decreasing trend. The results of TOPSIS analysis showed that the physiological indexes of tea trees most affected by Mg were chlorophyll, tea polyphenols and flavonoids, while the metabolic pathways most affected by Mg on gene expression were the metabolic pathways and biosynthesis of secondary metabolites. It can be seen that the effects of Mg on tea tree were mainly related to photosynthesis and synthesis of secondary metabolites, and Mg was beneficial for improving the photosynthetic capacity of tea tree, enhancing the accumulation of primary metabolites, and thus increasing tea yield. However, Mg was not conducive to the synthesis of secondary metabolites of tea tree and the accumulation of main quality indexes of tea leaves.