St. Paul is saying that the pagans, that is the gentiles, the non-Jews, will be judged by the natural law that is written on their heart. ( Romans 2:14-15)
The Jews, to whom the law was given, will be judged by the law they received from God through Moses… Paul says in verse 13 that it is not the hearers of the law who will be judged but the observers of the law who will be justified. Here Paul is speaking about the moral law.
All men know by nature what is right and what is wrong for God has written this on every heart. Because of our sinful nature, acquired because of original sin, man is tempted to disobey the natural law. This is why Christ established His Church, to help man to better understand his responsiblility to adhere to the natural law. No one can keep all the precepts of the natural law without the help of God’s grace.