We have measured third-order nonlinear susceptibility $({\ensuremath{\chi}}^{(3)})$ spectra of the two-dimensional (2D) cuprates ${\mathrm{La}}_{2}{\mathrm{CuO}}_{4}$ and ${\mathrm{Nd}}_{2}{\mathrm{CuO}}_{4}$ by third-harmonic generation. The $|{\ensuremath{\chi}}^{(3)}|$ spectra exhibit broad peaks with maximum values of $0.6\ifmmode\times\else\texttimes\fi{}{10}^{\ensuremath{-}10}\mathrm{esu}$ in ${\mathrm{La}}_{2}{\mathrm{CuO}}_{4}$ and $2\ifmmode\times\else\texttimes\fi{}{10}^{\ensuremath{-}10}\mathrm{esu}$ in ${\mathrm{Nd}}_{2}{\mathrm{CuO}}_{4}.$ These peaks are attributable to three-photon resonance to the charge transfer (CT) excited state. The ${\ensuremath{\chi}}^{(3)}$ phase spectrum of ${\mathrm{Nd}}_{2}{\mathrm{CuO}}_{4}$ has revealed that the two-photon resonance to the even CT state are hidden on the high-energy side of the ${\ensuremath{\chi}}^{(3)}$ peak. The difference in ${\ensuremath{\chi}}^{(3)}$ values between the 2D and 1D cuprates is discussed by considering differences in spin-charge coupling and in charge configurations between the 2D and 1D cases.