Exhausted T cells are a key component of immune cells that play a crucial role in the immune response against cancer and influence the efficacy of immunotherapy. Accurate assessment and measurement of T-cell exhaustion (TEX) are critical for understanding the heterogeneity of TEX in the tumor microenvironment (TME) and tailoring individualized immunotherapeutic strategies. In this study, we introduced DeepEpiTEX, a novel computational framework based on deep neural networks, for inferring the developmental hierarchy and functional states of exhausted T cells in the TME from epigenetic profiles. DeepEpiTEX was trained using various modalities of epigenetic data, including DNA methylation data, microRNA expression data, and long noncoding RNA expression data from 30 bulk solid cancer types in the TCGA pan-cancer cohort, and identified five optimal TEX subsets with significant survival differences across the majority of cancer types. The performance of DeepEpiTEX was further evaluated and validated in external multi-center and multi-type cancer cohorts, consistently demonstrating its generalizability and applicability in different experimental settings. In addition, we discovered the potential relationship between TEX subsets identified by DeepEpiTEX and the response to immune checkpoint blockade therapy, indicating that individuals with immune-favorable TEX subsets may experience the greatest benefits. In conclusion, our study sheds light on the role of epigenetic regulation in TEX and provides a powerful and promising tool for categorizing TEX in different disease settings.