The short answer is: we are righteous because God counts Jesus’ goodness instead of our sins when we have faith in Jesus. We are becoming holy as we obey God more and more in our lives.
Being righteous is being acceptable to God. Noah is the first person in the Bible to be called righteous: “Noah was a righteous man, blameless in his generation. Noah walked with God” (Genesis 6:9). Here we see the two aspects of being righteous: doing the right thing (being blameless) and having a relationship with God (walked with God).
In the Old Testament this is often connected to the law of God. In Psalm 1 the description of the righteous says “his delight is in the law of the LORD”. The law is about what you should do. But doing that is a delight, because it is the law of the Lord. So again, doing the right thing and having the right relationship go hand in hand.
In the final analysis, being righteous is dependent on faith. Paul strongly emphasizes this in Romans 3-5, and quotes Genesis 15:6 about Abraham to prove his point: “And he believed the LORD, and he counted it to him as righteousness.” So as Paul uses the term, being righteous is not based on what we do, but something we receive when we believe in God’s promises. Through faith in Jesus we receive forgiveness of sins and are acceptable to God.
Being holy means being set apart for God. It can be used for objects (a holy altar), time (a holy day), or persons (a holy priest). All believers are set apart for God, and are therefore made holy (or sanctified, which has the same meaning). We see this for example in 1 Corinthians 6:11: “But you were washed, you were sanctified, you were justified in the name of the Lord Jesus Christ and by the Spirit of our God.”
At the same time, there is also a sense in which being made holy is not a one time event, but a continuing process. 1 Thessalonians 5:23 says “Now may the God of peace himself sanctify you completely”. As we are living with God, we are growing in faith. More and more we are changed into the likeness of Jesus. More and more we display the fruit of the Holy Spirit. In that way, we are made holy. This process will only be complete when we are with God in heaven.
What we are and what we become
So one way to distinguish between being righteous and being holy is to say that we are righteous, and are becoming holy. We are righteous through faith in Christ, and we are becoming holy as we grow in faith in Christ. We have been declared righteous because of something that happened outside us: Christ died for our sins. This is God’s work for us. We are not contributing anything to that. We just receive God’s blessing of righteousness when we believe. We are becoming holy because something is happening in us: we are becoming more and more like Christ. This is the work of God in us. It is still God’s work, but we are fully involved, we are living it out.
Also read: How do we receive the Holy Spirit?