We derive the oxygen abundance (O/H), the nitrogen-to-oxygen (N/O) abundance ratio, and their corresponding radial gradients for a sample of 1431 galaxies from MaNGA DR15 survey using two different realizations of the strong line method: empirical R calibration and the Bayesian model-based {sc HII-CHI-mistry} ({sc HCm}) code. We find that both abundance calculation methods reveal a correlation between the O/H gradient and the stellar mass of a galaxy. This relation is non-linear, with the steepest average gradients in the intermediate mass range and flatter average gradients for high- and low-mass galaxies. The relation between the N/O gradient and the stellar mass is, on average, non-linear with the steepest gradients in the intermediate mass range ($log(M/M_sun) sim 10$), flatter gradients for high-mass galaxies, and the flattest gradients for low-mass galaxies. However, the general trend of steepening N/O gradient for higher masses, reported in previous studies, remains evident. We find a dependence between the O/H and N/O gradients and the galaxy mean stellar age traced by the $D$(4000) index. For galaxies of lower masses, both gradients are, generally, steeper for intermediate values of $D$(4000) and flatter for low and high values of $D$(4000). Only the most massive galaxies do not show this correlation. We interpret this behaviour as an evolution of the metallicity gradients with the age of stellar population. Though the galaxies with a positive slope of the $D$(4000) radial gradient tend to have a flatter O/H and N/O gradients, as compared to those with a negative $D$(4000) gradient.