To investigate early immune responses and explore the optimal vaccination periods, Nile tilapia at 1, 7, 14, 21, 28, 35, and 42 days after yolk sac collapse (DAYC) were immersed in formalin-killed Streptococcus agalactiae vaccine (FKV-SA). A specific IgM was first detected via ELISA in the 21 DAYC larvae (0.108 g) at 336 h after vaccination (hav), whereas in the 28–42 DAYC larvae (0.330–0.580 g), the specific IgM could be initially detected at 24 hav. qRT–PCR analysis of the TCRβ, CD4, MHCIIα, IgHM, IgHT, and IgHD genes in 21–42 DAYC larvae immunized with the FKV-SA immersion route for 24, 168, and 336 hav revealed that the levels of most immune-related genes were significantly higher in the vaccinated larvae at all DAYCs than in the control larvae (p < 0.05) at 336 hav. Immunohistochemistry demonstrated stronger IgM signals in the gills, head kidney, and intestine tissues at 21, 28, and 35 DAYC in all vaccinated larvae compared with the control. Interestingly, at all DAYCs, FKV-SA larvae exhibited significantly higher survival rates and an increased relative percent survival (RPS) than the control after challenge with viable S. agalactiae, particularly in larvae that were immunized with FKV-SA at 168 and 336 hav (p < 0.05).