Stomach adenocarcinoma (STAD) is a type of cancer which often at itsadvanced stage apon diagnosis and mortality in clinical practice. Several factors influencethe prognosis of STAD, including the expression and regulation of immune cells in the tumor microenvironment. We here investigated the biomarkers related to the diagnosis and prognosis of gastric cancer, hoping to provide insights for the diagnosis and treatment of gastric cancer in the future. STAD and normal patient RNA sequencing data sets were accessed from the cancer genome atlas (TCGA database). Differential genes were determined and obtained by using the R package DESeq2. The stromal, immune, and ESTIMATE scores are calculated by the ESTIMATE algorithm, followed by the modular genes screening using the R package WGCNA. Subsequently, the intersection between the modular gene and the differential gene was taken and the STRING database was used for PPI network module analysis. The R packages clusterProfiler, enrichplot, and ggplot2 were used for GO and KEGG enrichment analysis. Cox regression analysis was used to screen survival-related genes, and finally, the R package Venn Diagram was used to take the intersection and obtain 7 hub genes. The time-dependent ROC curve and Kaplan–Meier survival curve were used to find the SERPINE1 gene, which plays a critical role in prognosis. Finally, the expression pattern, clinical characteristics, and regulatory mechanism of SERPINE1 were analyzed in STAD. We revealed that the expression of SERPINE1 was significantly increased in the samples from STAD compared with normal samples. Cox regression, time-dependent ROC, and Kaplan–Meier survival analyses demonstrated that SERPINE1 was significantly related to the adverse prognosis of STAD patients. The expression of SERPINE1 increased with the progression of T, N, and M classification of the tumor. In addition, the results of immune infiltration analysis indicated that the immune cells’ expression were higher in high SERPINE1 expression group than that in low SERPINE1 expression group, including CD4+ T cells, B cells, CD8+ T cells, macrophages, neutrophils and other immune cells. SERPINE1 was closely related to immune cells in the STAD immune microenvironment and had a synergistic effect with the immune checkpoints PD1 and PD-L1. In conclusion, we proved that SERPINE1 is a promising prognostic and diagnostic biomarker for STAD and a potential target for immunotherapy.