Ferroptosis is a relatively new form of programmed cell death, which can enhance the efficacy of tumor immunotherapy by regulating the tumor microenvironment (TME). In the face of the dilemma of a great difference in the efficacy of immunotherapy for gastric cancer (GC) patients, the exploration of ferroptosis may assist us in predicting immunotherapy efficacy prior to treatment. The potential role of ferroptosis in TME still needs further elucidation. Based on ferroptosis-related genes (FRGs), we systematically evaluated ferroptosis molecular subtypes in gastric cancer. Additionally, the association between these molecular subtypes and the characteristics of TME was examined. A ferroptosis score was constructed to further explore the predictive efficacy of ferroptosis on the immunotherapy response in gastric cancer. There were also 32 other cancers that were evaluated. Three molecular subtypes of ferroptosis in gastric cancer were identified. The three immunophenotypes of tumor immune inflamed, immune excluded, as well as immune desert were mostly in agreement with the TME features of these three subtypes. The individual tumor genetic variation, TME characteristics, immunotherapy response, and prognosis could be assessed by a ferroptosis score. High ferroptosis scores in gastric cancer suggest stromal activation and immunosuppression. It is noted that tumors with a low ferroptosis score are characterized by extensive tumor mutations as well as an immune activation, which are associated with an enhanced immunotherapy response and an improved prognosis. This study reveals that ferroptosis plays an integral role in the regulation of the tumor immune microenvironment. The ferroptosis score may serve as an independent prognostic factor for GC and will deepen our understanding of the TME infiltration mechanisms as well as lead to more rational immunotherapy regimens.