Previously on Paul.
...Romans 1:17 says that the "righteousness of God" is revealed in the gospel about Jesus the king. In this expression alone we can trace the birth of Protestantism out of Roman Catholicism, as well as some of the disagreements among later Protestants. Up until the 1500s, almost everyone in the Western world defined themselves as Christian, and the only church in the West that existed was the Roman Catholic Church. 
Enter on the scene a German monk named Martin Luther in 1517. It was this year that Luther publically questioned some of the practices of the church of that day. But this moment in history was preceded by some personal breakthroughs that Luther experienced. One of them had to do with his understanding of Romans 1:17 and the phrase, "the righteousness of God."
At that time, Latin was the language of both the scholar and the church, and the Catholic church read the Scriptures in Latin. The vast uneducated majority of Christians thus did not hear the Bible read in their own languages. In Latin, the phrase "the righteousness of God" is "iustitia Dei." You can see that the first word looks a lot like the English word "justice."
And this is exactly how the Church took the word. The gospel reveals the justice of God. Now this is a possible meaning of the word for "righteousness" (dikaiosyne).  And it is true that God is just. But most interpreters prior to Luther took the verse to be about God distributing His justice both on believer and non-believer. Luther, who had a heightened sense of his own moral imperfection, found this verse troubling. At the time he believed in purgatory, a place where we burn off our remaining sinfulness and imperfection at death. The prospect of the "justice of God" thus was not good news to him.
His breakthrough was the realization that he could also take the phrase "the righteousness of God" as a reference to a "righteousness from God," that is, as a reference to God declaring us as righteous. Luther's theology of "justification" was born, for him the act of God declaring us righteous or innocent in the divine court. For Luther, we humans will never be acceptable to God in terms of our own goodness or morality. We come to God as sinners and we remain sinners even after we come to Christ. One of his most famous statements is that we are "at the same time righteous and a sinner, as long as we are always repenting." 
Some of Luther's thinking here seems true of Paul while other parts do not. For example, you will search long and hard to find any expectation or justification for sinning as a Christian in Paul's letters (cf., for example, Rom. 6:1-2, 12, 15). In the next chapter, we will see how Romans 7 is often, yet quite mistakenly, taken as a Christian's inability to stop sinning. Paul's position on this issue is not even close to ambiguous. Paul expects Christians to live righteous lives and those who do not are in serious danger of not being saved in the end.
Luther was correct, however, in the way he understood Paul's language about how a person comes to be right with God in the first place. Paul taught that a person becomes right with God, that is, is "justified," on the basis of faith--one's trust in what God has done through Jesus the Christ, Jesus the king (Rom. 3:28). We will talk a little more about the role of faith in Paul's theology in the next section. For now, it is enough to say that such faith for Paul was first and foremost centered on God the Father and what He had done through Jesus. However, God had accomplished these things through raising Jesus from the dead and by establishing Jesus as Lord of the cosmos. Therefore, Paul could also speak of our faith being directed toward Jesus, as well as on God the Father.
Unfortunately, in English we cannot see that the word "to justify" (dikaioō) is closely related to the word for "righteousness" (dikaiosynē). To justify is thus to "declare righteous." Luther rightly understood this word to be a legal term.  God pronounces us "not guilty." God declares us innocent in the divine court. He "justifies" us.
But Luther was only right about the moment of our initial faith in what God has done through Christ. The real trial, the actual moment of God's assessment that really counts, is at the judgment. Paul tells the believers at Corinth in 2 Corinthians 5:10 that they "must all appear before the judgment seat of the Christ so that each might give an account for the things he or she did with their body." He also says something similar in Romans 2 where he says that on the Day of Wrath and the revelation of the righteous judgment of God, God will pay each person according to the works they have done (2:5-6). Contrary to Luther, we might first be justified with God on the basis of our faith, but we will not be finally justified if our actions did not conform to God's righteous expectation from that point to our final time of judgment. 
Most scholars would also recognize today that while Luther's sense of "initial justification" was mostly accurate to Paul, his sense of what the phrase "the righteousness of God" meant in Romans 1:17 was probably wrong...
 In the east, of course, most Christians were Orthodox from the year 1054 on, when the Eastern and Western churches formally split from each other.
 In fact, most translations translate dikaiosyne as justice in Romans 3:26.
 simul iustus et peccator, semper repentans.
 Luther's understanding on justification had a major impact on John Wesley. Wesley's understanding of justification is basically that of Luther. It is on the question of sanctification after justification that they differed drastically.
 Certainly in Paul's earlier writings like 1 Thessalonians and 1 Corinthians, this judgment would seem to take place at the time of Christ's return and the resurrection. Most would say this timing continued throughout all Paul's writings. Some have argued, however, that 2 Corinthians sees this judgment taking place right after death and that Paul's sense of the immediacy of reward shifted a little during his time at Ephesus.