T cell antigen receptor (TCR) signaling drives distinct responses depending on the differentiation state and context of CD8(+) T cells. We hypothesized that access of signal-dependent transcription factors (TFs) to enhancers is dynamically regulated to shape transcriptional responses to TCR signaling. We found that the TF BACH2 restrains terminal differentiation to enable generation of long-lived memory cells and protective immunity after viral infection. BACH2 was recruited to enhancers, where it limited expression of TCR-driven genes by attenuating the availability of activator protein-1 (AP-1) sites to Jun family signal-dependent TFs. In naive cells, this prevented TCR-driven induction of genes associated with terminal differentiation. Upon effector differentiation, reduced expression of BACH2 and its phosphorylation enabled unrestrained induction of TCR-driven effector programs.