Tumor-infiltrating T cells often lose their effector function; however, the mechanisms are incompletely understood. We report that cholesterol in the tumor microenvironment induces CD8+ T cell expression of immune checkpoints and exhaustion. Tumor tissues enriched with cholesterol and cholesterol content in tumor-infiltrating CD8+ T cells were positively and progressively associated with upregulated T cell expression of PD-1, 2B4, TIM-3, and LAG-3. Adoptively transferred CD8+ T cells acquired cholesterol, expressed high levels of immune checkpoints, and became exhausted upon entering a tumor. Tumor culture supernatant or cholesterol induced immune checkpoint expression by increasing endoplasmic reticulum (ER) stress in CD8+ T cells. Consequently, the ER stress sensor XBP1 was activated and regulated PD-1 and 2B4 transcription. Inhibiting XBP1 or reducing cholesterol in CD8+ T cells effectively restored antitumor activity. This study reveals a mechanism underlying T cell exhaustion and suggests a new strategy for restoring T cell function by reducing cholesterol to enhance T cell-based immunotherapy.