The majority of gastric cancer (GC) patients are in a progressive stage at the initial stage of treatment, and the overall response rate to immunotherapy remains unsatisfactory largely due to the lack of effective prognostic biomarkers. Immunogenic cell death (ICD) was identified as a new form of regulated cell death that can activate adaptive immune responses and further promote immunotherapy efficacy. Therefore, we attempted to characterize the ICD-associated signature to stratify patients who could benefit from immunotherapy. In our study, two subgroups of patients were identified based on the data of 34 ICD-related genes extracted from The Cancer Genome Atlas database via consensus clustering. The estimated scores, stromal scores, immune scores, tumor purity, and survival rate showed significant differences between the low and high ICD groups. Then, we constructed an ICD-related risk signature, including IFNB1, IL6, LY96, and NT5E, using least absolute shrinkage and selection operator Cox regression analysis; then, high- and low-risk groups could be clearly distinguished. Notably, the risk score is a reliable predictor of the prognosis and immunotherapy outcome in GC, which was further validated in an immunohistochemistry assay. These results suggest that ICD is closely associated with the prognosis and tumor immune microenvironment in GC. Taken together, this study first constructed and validated a prognostic ICD-related signature to predict the survival and effect of immunotherapy in GC, which provided new insight for potent individualized immunotherapy strategies.