I said "one" because "one" is an accurate figure based on documentation.
Leonardo didn't spend time in Rome - let alone at the Vatican - until 1513, when he went there under the patronage of Giuliano de' Medici, Duc de Nemours. Giuliano was the brother of the new Pope, Leo X, and the Medici were always very good about patronizing hometown (Florentine) artists.
Once he got to Rome, it quickly became evident that other artists - such as Michelangelo and Raphael, who had both arrived there earlier - were already way ahead in the commissions game. Additionally, at this stage of his life Leonardo was painting less and less frequently, much preferring to sketch his many inventive designs, and studies and theories about anatomy, geometry and optics.
Thankfully, the Medici brothers were more interested in his expertise in these other areas than in Leonardo's brushwork. He appears to have spent the bulk of his time in Rome (from 1513 until some date between August, 1516 and May, 1517) traveling as an assistant to and helping Giuliano with the latter's military work for Leo X. (Keep in mind that the Pope's job description has evolved somewhat over the centuries, and He had need of military resources in the 16th century.) In other words, Leonardo was gainfully employed in the capacity of a portable, one-man Think Tank.
When he wasn't traveling with Giuliano, Leonardo designed a type of "burning mirror" that could harness solar power, was supposed to engineer the draining of the Pontine marshes and, rumor has it, whiled away a few hours in his apartment in the Palazzo Belvedere affixing a tiny set of experimental wings to a lizard.
As far as works of art go, though, the only painting - whose attribution is undisputed - executed during Leonardo's "Rome years" is that of St. John the Baptist (1513-16). And that is why I say "one." It would only even remotely be correct to say that Leonardo received "hundreds" of Vatican commissions within the context of a fictitious novel - which is not my job, here, and would now be redundant in any case.

