Death through Sin
The idea of "death through sin" in Romans 5:12 refers to Genesis 2:17, where God warns Adam not to eat the fruit of the tree of knowledge of good and evil. The NIV translation of Genesis 2:17 is questionable, so I'm offering four other translations, because the wording is important for understanding the passage:
but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die.—Genesis 2:17 (ESV)
but from the tree of the knowledge of good and evil you shall not eat, for in the day that you eat from it you will surely die.—Genesis 2:17 (NASB)
but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall die.—Genesis 2:17 (NRSV)
But of the tree of the knowledge of good and evil, thou shalt not eat of it: for in the day that thou eatest thereof thou shalt surely die.—Genesis 2:17 (KJV)
The NIV softens this a little, obscuring the fact that the death is meant to occur on the same day:
but you must not eat from the tree of the knowledge of good and evil, for when you eat of it you will surely die.—Genesis 2:17 (NIV)
What is a Day?
God explicitly says that they will die on the day they eat the fruit. However, they did not physically die before sunset.
There are a couple ways to make sense of this. Either "day" does not mean a 24-hour day here, or "die" does not mean physical death (or both).
Most of the early Christians, using 2 Peter 3:8 ("But do not ignore this one fact, beloved, that with the Lord one day is like a thousand years, and a thousand years are like one day.") interpreted the "days" of Genesis as 1000-year periods.
For example, second century Christian apologist Justin Martyr wrote in his Dialogue with Trypho, chapter LXXXI:
For as Adam was told that in the day he ate of the tree he would die, we know that he did not complete a thousand years. We have perceived, moreover, that the expression, 'The day of the Lord is as a thousand years,' is connected with this subject.
You can see more examples in my answer to the How old is old earth creationism? question.
What is Death?
The early Christians also frequently understood "death" to mean not dying physically, but being cut off from the eternal life that Christ brings. Paul, in that very same letter to the Romans, uses it this way numerous times:
For the wages of sin is death, but the free gift of God is eternal life in Christ Jesus our Lord.—Romans 6:23 (NRSV)
I was once alive apart from the law, but when the commandment came, sin revived and I died, and the very commandment that promised life proved to be death to me.—Romans 7:9-10 (NRSV)
as well as in his other letters:
For the message about the cross is foolishness to those who are perishing, but to us who are being saved it is the power of God.1 Corinthians 1:18 (NRSV)
For godly grief produces a repentance that leads to salvation and brings no regret, but worldly grief produces death.—2 Corinthians 7:10 (NRSV)
We can see this usage immediately following the "thousand years" verse in 2 Peter:
The Lord is not slow about his promise, as some think of slowness, but is patient with you, not wanting any to perish, but all to come to repentance.—2 Peter 3:9 (NRSV)
and in one of the best-known Bible verses:
For God so loved the world that he gave his only Son, so that everyone who believes in him may not perish but may have eternal life.—John 3:16 (NRSV)
This usage continued in the early church. The Didache (the full Greek title translates to "Teaching of the Lord to the Gentiles by the Twelve Apostles") was a late first or early second Christian document summarizing the doctrines of the early church. It explains the difference between life and death as:
There are two ways, one of life and one of death, but a great difference between the two ways. The way of life, then, is this: First, you shall love God who made you; second, love your neighbor as yourself, and do not do to another what you would not want done to you. And of these sayings the teaching is this: Bless those who curse you, and pray for your enemies, and fast for those who persecute you.—Didache chapter 1
And the way of death is this: First of all it is evil and accursed: murders, adultery, lust, fornication, thefts, idolatries, magic arts, witchcrafts, rape, false witness, hypocrisy, double-heartedness, deceit, haughtiness, depravity, self-will, greediness, filthy talking, jealousy, over-confidence, loftiness, boastfulness; persecutors of the good, hating truth, loving a lie, not knowing a reward for righteousness, not cleaving to good nor to righteous judgment, watching not for that which is good, but for that which is evil; from whom meekness and endurance are far, loving vanities, pursuing revenge, not pitying a poor man, not laboring for the afflicted, not knowing Him Who made them, murderers of children, destroyers of the handiwork of God, turning away from him who is in want, afflicting him who is distressed, advocates of the rich, lawless judges of the poor, utter sinners. Be delivered, children, from all these.—Didache chapter 5
Romans 5:12 is not talking about physical death but spiritual death, i.e., separation from God. That's what sin does; it separates us from God.