Background: The tumor immune microenvironment (TIME) is an external immune system that regulates tumorigenesis. However, cellular interactions involving the TIME in hepatocellular carcinoma (HCC) are poorly characterized. Methods: In this study, we used multidimensional bioinformatic methods to comprehensively analyze cellular TIME characteristics in 735 HCC patients. Additionally, we explored associations involving TIME molecular subtypes and gene types and clinicopathological features to construct a prognostic signature. Results: Based on their characteristics, we classified TIME and gene signatures into three phenotypes (TIME T1-3) and two gene clusters (Gene G1-2), respectively. Further analysis revealed that Gene G1 was associated with immune activation and surveillance and included CD8 + T cells, natural killer cell activation, and activated CD4 + memory T cells. In contrast, Gene G2 was characterized by increased M0 macrophage and regulatory T cell levels. After calculation of principal component algorithms, a TIME score (TS) model, including 78 differentially expressed genes, was constructed based on TIME phenotypes and gene clusters. Furthermore, we observed that the Gene G2 cluster was characterized by high TS, and Gene G1 was characterized by low TS, which correlated with poor and favorable prognosis of HCC, respectively. Correlation analysis showed that TS had a positive association with several clinicopathologic signatures [such as grade, stage, tumor (T), and node (N)] and known somatic gene mutations (such as TP53 and CTNNB1). The prognostic value of the TS model was verified using external data sets. Conclusion: We constructed a TS model based on differentially expressed genes and involving immune phenotypes and demonstrated that the TS model is an effective prognostic biomarker and predictor for HCC patients.