An approach based on the finite-difference time-domain method is developed for simulating the dynamics of passive mode locking in vertical-cavity surface-emitting lasers (VCSELs). The material response is modeled by the effective semiconductor Bloch equations through a resonant polarization term in the Maxwell's equations. Nonlinear gain saturation is incorporated through a gain compression factor in the equation governing the dynamics of the resonant polarization. An extended-cavity VCSEL with a quantum-well saturable absorber is simulated, and stable mode-locking pulses are obtained. Fine features of the spatial profile of the mode-locked pulses are also studied within this approach.