T-cell development in the thymus is a complex and highly regulated process, involving a wide variety of cells and molecules which orchestrate thymocyte maturation into either CD4+ or CD8+ single-positive (SP) T cells. Here, we briefly review the process regulating T-cell differentiation, which includes the latest advances in this field. In particular, we highlight how, starting from a pool of hematopoietic stem cells in the bone marrow, the sequential action of transcriptional factors and cytokines dictates the proliferation, restriction of lineage potential, T-cell antigen receptors (TCR) gene rearrangements, and selection events on the T-cell progenitors, ultimately leading to the generation of mature T cells. Moreover, this review discusses paradigmatic examples of viral infections affecting the thymus that, by inducing functional changes within this lymphoid gland, consequently influence the behavior of peripheral mature T-lymphocytes.