In order to develop an N6-methyladenosine-related gene prognostic index (m6A-GPI) that can predict the prognosis in colorectal cancer (CRC), we obtained m6A-related differentially expressed genes (DEGs) based on The Cancer Genome Atlas (TCGA) and m6Avar database, seven genes were screened by weighted gene co-expression network analysis (WGCNA) and least absolute shrinkage and selection operator (LASSO) analysis. Then, m6A-GPI was constructed based on the risk score. Survival analysis indicated that patients in the lower m6A-GPI group have more prolonged disease-free survival (DFS), and different clinical characteristic groups (tumor site and stage) also showed differential risk scores. In the analysis of the molecular characteristics, the risk score is positively associated with homologous recombination defects (HRD), copy number alterations (CNA), and the mRNA expression-based stemness index (mRNAsi). In addition, m6A-GPI also plays an essential role in tumor immune cell infiltration. The immune cell infiltration in the low m6A-GPI group is significantly higher in CRC. Moreover, we found that CIITA, one of the genes in m6A-GPI was up-regulated in CRC tissues based on real-time RT-PCR and Western blot. m6A-GPI is a promising prognostic biomarker that can be used to distinguish the prognosis of CRC patients in CRC.