Question: Where Cain got his wife.
Let me point you to the Bible. First look at Genesis 4:15 where God said whoever kills Cain will be punished. God set a mark on Cain so if people find him they would not kill him. So God is telling us there are other people out there at the time of Cain's punishment.
Genesis 4 is the account of the Birth of Cain and Abel, the murder of Abel and the punishment of Cain. From verse 25 onwards into chapter 5 the Bible takes us back in time and tracks the birth of Seth and his descendents. Genesis Chapter 5 verse 4 tells us that Adam lived 800 years after Seth was born, and that Adam had sons and daughters.
Now read the rest of chapter 5 and you will see that the population grew great, as they all lived long lives and had children that lived married and had more children.
So Cain lived about the average life span for that time of around 900 years. He built a city, Gen. 4:17 tells us he built a city, so there was a large population already. Men were still having babies when they were 500 years old, as did Noah.
With regard to the Old Testament and the time period between Adam and Noah, Henry Morris says,
"...the recorded average age of the nine antediluvian patriarchs was 912 years. Recorded ages at the births of their children ranged from 65 years (Mahalalel, Gen. 5:15; Enoch, Gen. 5:21) to 500 years (Noah, Gen. 5:32). Everyone of them is said to have had "sons and daughters" so that each family had at least 4 children, and probably more.
"As an ultraconservative assumption, let C = 3, x = 5, and n = 16.56. These constants correspond to an average family of six children, an average generation of 100 years and an average lifespan of 500 years.
"On this basis the world population at the time of the Flood would have been 235 million people. This probably represents in a gross underestimate of the numbers who actually perished in the Flood."