Heme is a coordination complex formed by the binding of iron ions and porphyrin rings. Its metabolic processes are associated with various cancers, including gastric cancer (GC). In recent years, long non-coding RNAs (LncRNAs) have been identified as key regulatory factors in GC. However, the role of LncRNAs associated with heme metabolism in GC and their relationship with prognosis have not been reported. In this study, we constructed a novel LncRNAs signature related to heme metabolism (HMlncSig) and validated its prognostic value for predicting the survival of GC patients through training, test, and entire cohorts. Kaplan-Meier analysis demonstrated that patients in the high-risk group had shorter survival times. Univariate and multivariate Cox regression analysis showed that HMlncSig was an independent prognostic indicator for GC patients, regardless of other clinical pathological features. Gene ontology and Kyoto Encyclopedia of Genes and Genomes enrichment analysis and gene set variation analysis pathways showed that the activation of these markers may be involved in tumor progression, influencing the survival of GC patients. The nomogram, based on HMlncSig score and clinical features, demonstrated the strong predictive ability of this signature. Additionally, significant differences were observed between the high-risk and low-risk groups in terms of immune cell subtypes, expression of immune checkpoint genes, and response to chemotherapy and immunotherapy. Through clinical validation, we found that the risk score and heme levels of GC patients were both significantly elevated and correlated with the degree of malignancy. Furthermore, we found that AP000692.1, a key gene in this signature, promoted the proliferation, migration, and invasion of GC cells. In conclusion, our HMlncSig model has significant predictive value for the prognosis of GC patients and can provide clinical guidance for personalized immunotherapy.