Mature B cells can make IgM (and IgD) without T cell help. IgM antibodies usually are released shortly after infection (couple days) when the B cells are activated. IgM have lower affinity to the antigen but because IgM is pentameric, they are still often effective. If the B cell gets T-cell help, recombination occurs causing class switching and the B cell can start producing IgG. Through variable domain rearrangement and mutation, higher affinity IgG will be produced over a few more days. Eventually some of the B cells producing the higher affinity IgG may become memory B cells, plasmablasts and plasma cells allowing for longer term immunity
A key is T cell help. Some of the activated T cells that can help induce B cells to make IgG will become memory T cells.