The Church has no teaching regarding whether these ages are to be taken literally or not. The Church will say that whatever Scripture says is inerrant but must be understood in terms of the conventions of literature that were in use at the time.
It is known that, in many ancient cultures, fantastically long lives were assigned to famous forebears. This could be an indication that the ages are to be taken as symbolic of the greatness and venerability of the individuals.
However, this is not something the Church has taught. God can keep people alive as long as he wants. If he wants someone to live to be 900 years old, then that person can do so.