Dragons do not necessarily become more talented the longer they sleep, but sleeping for a lengthy period usually means the dragon had a more substantial 'accumulation' before hibernation. This accumulation during hibernation allows them to receive more knowledge from the Dragon Legacy, whether actively or passively. After all, most ordinary dragons end their hibernation like bears waking from winter sleep—depleted of body fat and roused by sheer hunger. Yet for someone like David, who was still in his wyrmling stage and managed to sleep for seven years straight, Nifadora could not recall ever seeing such a case, nor had she heard of it in the Dragon Legacy.
This duration was essentially within the realm of an adult dragon, like David's mother, the Crimson Calamity Pafila. After all, a young dragon doesn't have many seven-year periods to squander in such a manner.