Solute carrier family 7 member 11 (SLC7A11), glutathione peroxidase 4 (GPX4), and apoptosis inducing factor mitochondria associated 2 (AIFM2) are the key regulators in ferroptosis. However, the expression patterns and prognostic roles of these genes in pan-cancer are still largely unclear. The expression patterns and prognostic roles of SLC7A11, GPX4, and AIFM2 and the relationships between the expression levels of these genes and immune infiltration levels in pan-cancer were analyzed by using TIMER, gene expression profiling interactive analysis (GEPIA), Oncomine, and Kaplan–Meier databases. Our results showed that both SLC7A11 and GPX4 were overexpressed in colorectal cancer, and SLC7A11 was overexpressed in lung cancer. High levels of SLC7A11 and AIFM2 were significantly linked with the shortened disease-free survival and overall survival (OS) in adrenocortical carcinoma (ACC), respectively. And high expression of SLC7A11, GPX4, and AIFM2 were significantly correlated with the shortened OS of acute myeloid leukemia patients. In esophageal carcinoma (ESCA), GPX4 expression was significantly associated with the infiltration of macrophage and myeloid dendritic cell, and AIFM2 expression was significantly associated with the infiltration of CD4+ T cell. Importantly, GPX4 expression was positively correlated with the expression levels of monocyte markers (CD14 and CD115) and M2 macrophage markers (VSIG4 and MS4A4A) both in ESCA and in head and neck squamous cell carcinoma (HNSC). In summary, SLC7A11, GPX4, and AIFM2 are dysregulated in many types of cancers, and are candidate prognostic biomarkers for many types of cancers, and can be used to evaluate the infiltration of immune cells in tumor tissues.