The accuracy of the chronologies in Genesis 5 and 11 has been greatly debated. People have proposed various means of adjusting the figures to more realistic values, on the assumption that there has been some textual error. (This is partly motivated by differences between the Masoretic Text and the Septuagint, suggesting some confusion on the part of translators and editors.) Others are happy to assume that the text we have received is essentially correct.
Augustine discusses some such schemes in City of God 15.9-15; he believes that the patriarchs did indeed live to the stated ages (basically, because stranger things have happened). The basic problem he finds with trying to rescale the figures (he discusses several alternatives, such as that one "year" in the text should really be one month, or that all the numbers are inflated by a factor of ten) is that the Genesis account also gives the ages at which each man fathered his son. Enosh was 90 when he had his son (Genesis 5:9) and 905 when he died (5:11). Rescaling either gives him a long lifespan in any case, or has him fathering Kenan at an unusually young age.
Julius Wellhausen in Prolegomena to the History of Israel (1882) suggested a complicated scheme based on a "Great Year" of 4000 years in total from Adam to the rededication of the Temple in 164BC. He puts the Exodus at 2666 years after the creation, with the 26 generations from Adam to Aaron each representing a century (the remaining 66 years are assigned to Eleazar). Many other scholars have since refined this idea, suggesting tweaks and trying to understand the textual influences. Under this family of interpretations, the ages of the patriarchs are purely notional - there may be some symbolic reason for the particular numbers being as they are, but the purpose is simply to express generational decline. This is analogous to documents from surrounding cultures, such as the Sumerian King List, which also feature enormous but decreasing lifespans.
Martin Luther assumes in his Commentaries on Genesis (vol. 2, ch. 5, paragraphs 34-43) that the ages are as stated. He attributes their long lifespans to better diet, and to their righteousness:
35) Though the body was sounder than at present, yet the general vigor and strength of limb which men had in paradise before the advent of sin, had passed away. It is true, however, that their bodily well-being was enhanced when, after the fall, they were renewed and regenerated through faith in the promised seed. For the same reason, also, sin was weakened through faith in the seed. As for us, we have lost their strength and vigor just in proportion as we have departed from their righteousness.
36) With reference to food, who cannot easily believe that one apple, in that primeval age, was more excellent and afforded a greater degree of nourishment than a thousand in our time? The roots, also, on which they fed, contained infinitely more fragrance, virtue and savor, than they possess now. All these conditions, but notably holiness and righteousness, the exercise of moderation, then the excellence of the fruit and the salubrity of the atmosphere - all these tended to produce longevity till the time came for the establishment of a new order by God which resulted in a decided reduction of the length of man's life.
Luther also points out that the chronology has many of the patriarchs alive at the same time, with Adam dying not long before Noah was born:
43) Truly that primeval time was a "golden age," in comparison with which our present age is scarcely worthy of being called the age of mud. During those primeval centuries, there lived at the same time nine patriarchs, together with their posterities, and all of them in harmony concerning the faith in the blessed seed! All these glorious things Moses just mentions, but does not explain; otherwise this would be the history of histories.