Dragons being "wyrms", we can, if we wish, compare them to their real-world relatives, the snakes, some of whom can go without
food -- or even water -- for months, by slowing their metabolism --- up to 70% -- and subsisting on their body fat. The bigger and longer they are, the longer they can go. And
Smaug was much bigger and longer than the average snake.
Further, they don't hibernate exactly, but are mostly quiescent, while doing this. Smaug was asleep until disturbed by
Bilbo, and we don't know how long he had been; years, apparently. So it wouldn't be surprising that he could go so long without a meal, especially, as noted above, after gorging himself on an entire town or two.
But of course, dragons are mythical
creatures, so capable of mythical feats.