We compute the nonlinear optical response of doped monolayer and bilayer graphene using the full dispersion based on tight-binding models. The response is derived with the density matrix formalism using the length gauge and is valid for any periodic system, with arbitrary doping. By collecting terms that define effective nonlinear response tensors, we identify all nonlinear Drude-like terms (up to third order) and show that all additional spurious divergences present in the induced current vanish. The nonlinear response of graphene comprises a large Drude-like divergence and three resonances that are tightly connected with transitions occurring in the vicinity of the Fermi level. The analytic solution derived using the Dirac approximation captures accurately the first- and third-order responses in graphene, even at very high doping levels. The quadratic response of gapped graphene is also strongly enhanced by doping, even for systems with small gaps such as commensurate structures of graphene on SiC. The nonlinear response of bilayer graphene is significantly richer, combining the resonances that stem from doping with its intrinsic strong low-energy resonances.