Gastric cancer is the fourth most frequent cancer and has a high death rate. Immunotherapy represented by PD-1 has brought hope for the treatment of advanced gastric cancer. Methylation of the m6A genes is linked to the onset and progression of numerous cancers, but there are few studies on gastric cancer. The main purpose of this study aims to analyze the relationship between m6A RNA methylation regulators, PD-L1, prognosis and tumor immune microenvironment (TIME) in gastric cancer. The Cancer Genome Atlas (TCGA) and Genotype Tissue Expression (GTEx) databases were used to acquire transcriptomic data and clinical information from gastric cancer patients. The changes in m6A regulator expression levels in gastric cancer tissues and normal tissues were studied. Consensus clustering analysis was used to separate gastric cancer samples into two categories. We employed Least Absolute Shrinkage, Selection Operator (LASSO) Cox regression analysis, Gene Set Enrichment Analysis (GSEA), and cBioPortal to analyze the m6A regulators, PD-L1 and TIME in gastric cancer. In gastric cancer tissues, the majority of m6A regulatory factors are considerably overexpressed. Two gastric cancer subgroups (Cluster1/2) based on consensus clustering of 21 m6A regulators. PD-L1 and PD-1 expression levels were significantly higher in gastric cancer tissues, and they were significantly linked with METTL3, WTAP, HNRNPD, ZC3H7B, METTL14, FTO, PCIF1, HNRNPC, YTHDF1 and YTDHF2. Cluster1 showed a large increase in resting memory CD4+ T cells, regulatory T cells, naïve B cells, active NK cells, and resting Mast cells. Cluster1 and Cluster2 were shown to be involved in numerous critical signaling pathways, including base excision repair, cell cycle, nucleotide excision repair, RNA degradation, and spliceosome pathways. Gastric cancer RiskScores based on prognostic factors have been found as independent prognostic indicators. The amount of tumor-infiltrating immune cells is dynamically affected by changes in the copy number of m6A methylation regulators associated with TIME.