St. Thomas discusses this question in his opuscule
De Æternitate Mundi (https://isidore.co/aquinas/DeEternitateMundi.htm). It begins as follows:
QuoteLet us assume, in accordance with the Catholic faith, that the world had a beginning in time. The question still arises whether the world could have always existed, and to explain the truth of this matter, we should first distinguish where we agree with our opponents from where we disagree with them. If someone holds that something besides God could have always existed, in the sense that there could be something always existing and yet not made by God, then we differ with him: such an abominable error is contrary not only to the faith but also to the teachings of the philosophers, who confess and prove that everything that in any way exists cannot exist unless it be caused by him who supremely and most truly has existence. However, someone may hold that there has always existed something that, nevertheless, had been wholly caused by God, and thus we ought to determine whether this position is tenable.
Other Christian philosophers have held that one can know scientifically whether the universe is eternal, but St. Thomas believes this truth is only knowable by the Catholic faith.