Globally, hepatocellular carcinoma (HCC) is the sixth most common cancer. In this study, the correlation between mitophagy and HCC prognosis was evaluated using data from The Cancer Genome Atlas (TCGA). Clinical and transcriptomic data of HCC patients were downloaded from TCGA dataset, and mitophagy-related gene (MRG) datasets were obtained from the Molecular Signature Database. Then, a consensus clustering analysis was performed to classify the patients into two clusters. Furthermore, tumor prognosis, clinicopathological features, functional analysis, immune infiltration, immune checkpoint (IC)-related gene expression level, tumor stem cells, ferroptosis status, and N6-methyladenosine analysis were compared between the two clusters. Finally, a mitophagy-related signature was developed. Two clusters (C1 and C2) were identified using the consensus clustering analysis based on the MRG signature. Patients with the C1 subtype exhibited upregulated pathways with better liver function, downregulated cancer-related pathways, lower cancer stem cell scores, lower Tumor Immune Dysfunction and Exclusion scores (TIDE), different ferroptosis status, and better prognosis compared with the patients with the C2 subtype. The C2 subtype was characterized by the increased grade of HCC, as well as the increased number of immune-related pathways and m6A-related genes. Higher immune scores were also observed for the C2 subtype. A signature containing four MRGs (PGAM5, SQSTM1, ATG9A, and GABARAPL1) which can accurately predict the prognosis of HCC patients was then identified. This four-gene signature exhibited a predictive effect in five other cancer types, namely glioma, uveal melanoma, acute myeloid leukemia, adrenocortical carcinoma, and mesothelioma. The mitophagy-associated subtypes of HCC were closely related to the immune microenvironment, immune checkpoint-related gene expression, cancer stem cells, ferroptosis status, m6A, prognosis, and HCC progression. The established MRG signature could predict prognosis in patients with HCC.