Cellular senescence (CS) is thought to be the primary cause of cancer development and progression. This study aimed to investigate the prognostic role and molecular subtypes of CS-associated genes in gastric cancer (GC). The CellAge database was utilized to acquire CS-related genes. Expression data and clinical information of GC patients were obtained from The Cancer Genome Atlas (TCGA) database. Patients were then grouped into distinct subtypes using the "Consesus- ClusterPlus" R package based on CS-related genes. An in-depth analysis was conducted to assess the gene expression, molecular function, prognosis, gene mutation, immune infiltration, and drug resistance of each subtype. In addition, a CS-associated risk model was developed based on Cox regression analysis. The nomogram, constructed on the basis of the risk score and clinical factors, was formulated to improve the clinical application of GC patients. Finally, several candidate drugs were screened based on the Cancer Therapeutics Response Portal (CTRP) and PRISM Repurposing dataset. According to the cluster result, patients were categorized into two molecular subtypes (C1 and C2). The two subtypes revealed distinct expression levels, overall survival (OS) and clinical presentations, mutation profiles, tumor microenvironment (TME), and drug resistance. A risk model was developed by selecting eight genes from the differential expression genes (DEGs) between two molecular subtypes. Patients with GC were categorized into two risk groups, with the high-risk group exhibiting a poor prognosis, a higher TME level, and increased expression of immune checkpoints. Function enrichment results suggested that genes were enriched in DNA repaired pathway in the low-risk group. Moreover, the Tumor Immune Dysfunction and Exclusion (TIDE) analysis indicated that immunotherapy is likely to be more beneficial for patients in the low-risk group. Drug analysis results revealed that several drugs, including ML210, ML162, dasatinib, idronoxil, and temsirolimus, may contribute to the treatment of GC patients in the high-risk group. Moreover, the risk model genes presented a distinct expression in single-cell levels in the GSE150290 dataset. The two molecular subtypes, with their own individual OS rate, expression patterns, and immune infiltration, lay the foundation for further exploration into the GC molecular mechanism. The eight gene signatures could effectively predict the GC prognosis and can serve as reliable markers for GC patients.