We report a measurement of the D^{0} and D^{+} lifetimes using D^{0}→K^{-}π^{+} and D^{+}→K^{-}π^{+}π^{+} decays reconstructed in e^{+}e^{-}→cc[over ¯] data recorded by the Belle II experiment at the SuperKEKB asymmetric-energy e^{+}e^{-} collider. The data, collected at center-of-mass energies at or near the ϒ(4S) resonance, correspond to an integrated luminosity of 72 fb^{-1}. The results, τ(D^{0})=410.5±1.1(stat)±0.8(syst) fs and τ(D^{+})=1030.4±4.7(stat)±3.1(syst) fs, are the most precise to date and are consistent with previous determinations.