For when Gentiles, who do not have the law, by nature do what the law requires, they are a law to themselves, even though they do not have the law. (ESV)
When we think of the Law we think of the current set of laws that govern us in our country. When we read of the Law in Scripture we are speaking of the Law given specifically to the Jewish people through Moses. This Law that was given to the Jews taught them how to treat the Lord and how to treat one another.
The Gentiles had no such law. Gentiles are simply "non-Jews." The Apostle Paul describes these Gentiles as sometimes obeying the Jewish Law even though they do not have the Law nor do they know it. How is that possible? Because all people seem to have some sort of values that they try to live up to.
A set of innate laws that we all seem to come wired with is a reflection of our maker. Even godless Gentiles are born in God's image. Man upholds things like honesty, justice, compassion, goodness and even kindness towards others as a standard for living. Atheists can be good neighbors. Heathens can obey basic laws.
The question would come to mind, "If the Gentiles do not have the Law, but keep their own law is that enough to save them?" The answer is no. God's standard is absolute perfection. The Jews were not able to keep their Law that was given to them by God himself. The Gentiles, while having a certain code to live by, do not keep their own laws perfectly. We are all law-breakers.
God's Law is perfect. We cannot keep it. We cannot even keep our own law perfectly. All this points us to our need for our wonderful Savior. He kept the Law for us. We are made righteous by our faith in his work on our behalf.