The process in which an antigenically naive CD4-positive, alpha-beta T cell acquires the specialized features of an effector, regulatory, or memory T cell as part of an immune response. Effector T cells include cells which provide T cell help or exhibit cytotoxicity towards other cells.