Hepatocellular carcinoma (HCC) is an inflammation-associated tumor involved in immune tolerance and evasion in the immune microenvironment. Immunotherapy can enhance the immune response of the body, break immune tolerance, and then recognize and kill tumor cells. The polarization homeostasis of M1 and M2 macrophages in tumor microenvironment (TME) is involved in the occurrence and development of tumors and has been considered a hot topic in tumor research. Programmed cell death ligand 1 (PD-L1) plays an important role in the polarity of TAM and affects the prognosis of HCC patients as a target of immunotherapy. To this end, efforts were hereby made to further explore the application value of PD-L1, M1 macrophages (CD86), and M2 macrophages (CD206) in the prognosis assessment of HCC, their correlation with immune cell infiltration in HCC tissues, and their bioenrichment function. The gene expression omnibus (GEO) and the Cancer Genome Atlas (TCGA) database were used to analyze the expression of PD-L1, CD86, and CD206 in different tumor tissues. The correlation between the expression of PD-L1, CD86, and CD206 and the infiltration of immune cells was analyzed using the Tumor Immune Estimation Resource (TIMER). The tissue specimens and clinicopathological data of hepatocellular carcinoma patients having undergone surgical treatment in our hospital were collected. Immunohistochemistry was used to verify the expression of PD-L1, CD86, and CD206, and analyze the relationship with clinicopathological features and prognosis of patients. Besides, nomogram was constructed to predict the overall survival (OS) of patients at 3 and 5years. Finally, the protein-protein interaction network information was analyzed using STRING database, and GO analysis and KEGG (Kyoto Encyclopedia of Genes and Genomes) analysis were performed to study the biological functions of PD-L1, CD86, and CD206. Bioinformatics analysis found that PD-L1, CD86, and CD206 were underexpressed in various tumor tissues including liver cancer, while the present immunohistochemical detection found that PD-L1, CD86, and CD206 were overexpressed in liver cancer tissues. Expressions of PD-L1, CD86, and CD206 were positively correlated with the infiltration level of immune cells in liver cancer, while the expression of PD-L1 was positively correlated with the degree of tumor differentiation. Meanwhile, the expression level of CD206 was positively correlated with gender and preoperative hepatitis, and patients with high expression of PD-L1 or low expression of CD86 had poor prognosis. AJCC stage, preoperative hepatitis, and the expression levels of PD-L1 and CD86 in cancer tissues were independent risk factors affecting survival of patients after radical hepatoma surgery. KEGG pathway enrichment analysis showed that PD-L1 was significantly enriched in T cell aggregation and lymphocyte aggregation, and might be involved in the formation of T cell antigen receptor CD3 complex and cell membrane. Besides, CD86 was significantly enriched in positive regulation of cell adhesion, regulation of mononuclear cell proliferation, regulation of leukocyte proliferation, and transduction of T cell receptor signaling pathway, while CD206 was significantly enriched in type 2 immune response, cellular response to LPS, cellular response to LPS, and involvement in cellular response to LPS. In conclusion, these results suggest that PD-L1, CD86, and CD206 may be involved not only in the occurrence and development of HCC, but also in immune regulation, indicating the potential role of PD-L1 and CD86 as potential biomarkers and new therapeutic targets for prognosis assessment of liver cancer.