Read the Bible -- it's ambiguous-- or Google the Catholic-Luther controversy.
As I said. this was one of the controversies that sparked the Protestant Reformation in Europe.
The Catholic Church Teaches Salvation by Works
What was Martin Luther's view on salvation?
By what I know, the problem is that they take only small part of the whole, which is why they come to different conclusion. In short Bible teaches that forgiveness is free, doesn’t require anything really. But, it is not all, eternal life is promised for righteous, which is why person must be righteous to get it. And it doesn’t not come because of what person does, but because of what he is. And if person is righteous, he does righteous actions, not because of reward, but because he understands it is good. Works can tell what kind of person one is, that is why they are meaningful, but they are only like fruit of tree, end result, not the cause.
These will go away into eternal punishment, but the righteous into eternal life.
Mat. 25:46
For the wages of sin is death, but the free gift of God is eternal life in Christ Jesus our Lord.
Romans 6:23