Memory T cells sustain effector T-cell production while self-renewing in reaction to persistent antigen; yet, excessive expansion reduces memory potential and impairs antitumor immunity. Epigenetic mechanisms are thought to be important for balancing effector and memory differentiation; however, the epigenetic regulator(s) underpinning this process remains unknown. Herein, we show that the histone methyltransferase Ezh2 controls CD8+ T memory precursor formation and antitumor activity. Ezh2 activates Id3 while silencing Id2, Prdm1 and Eomes, promoting the expansion of memory precursor cells and their differentiation into functional memory cells. Akt activation phosphorylates Ezh2 and decreases its control of these transcriptional programs, causing enhanced effector differentiation at the expense of T memory precursors. Engineering T cells with an Akt-insensitive Ezh2 mutant markedly improves their memory potential and capability of controlling tumor growth compared to transiently inhibiting Akt. These findings establish Akt-mediated phosphorylation of Ezh2 as a critical target to potentiate antitumor immunotherapeutic strategies.