A one-dimensional numerical model to study the evolution of longitudinal electrostatic wakefields, generated by propagation of a circularly polarized laser pulse in magnetized plasma has been presented. The direction of the external magnetic field is considered to be along as well as opposite to the axis of propagation of the laser pulse. Further, two-dimensional particle-in-cell code is used to obtain the generated wakefields. Separatrix curves are plotted to study the trapping and energy gain of an externally injected test electron, by the generated electrostatic wakefields, in the relativistic regime. Under appropriate conditions, an enhancement in the peak energy of an externally injected electron in magnetized plasma, as compared to the unmagnetized case, has been observed.