The notion of a heavenly reward runs through the New Testament. Our Lord promises rich rewards for the poor in spirit, to the meek, to those who suffer for Him or do the works of mercy. The parables deal with this theme constantly. St. Paul bids us, “be steadfast . . . always abounding in the work of the Lord, knowing that your labor is not in vain in the Lord.” (1 Corinthians 15:58) The Council of Trent says that the good works of the just are both a gift of God and the merit of the just man.
What, you may ask, is the basis in God of our merit? While we can confer no real benefits on God by our service which indeed already belongs to Him, yet God can bind Himself to reward the good actions of His children. Our merit rests on the divine promise. The basis in us of merit is:
1.) the state of grace. “The worth of the work,” says St. Thomas Aquinas, "depends on the dignity of grace, whereby a man, being made partaker of the Divine Nature, is adopted as a son by God, to whom the inheritance is due by right of adoption."
2.) The action must be performed before death, the “night when no man can work.” (John 9:4)
3.) The action must be free, morally good, performed with the help of grace, and in some way directed to the beatific vision. It is likely that all deliberate acts of the just which are not sinful are meritorious.