The process in which a naive B cell acquires the specialized features of a mature or memory B cell during an immune response.