Where did Cain get his wife?

Cain's wife was probably his sister or a niece.

There was no stigma or rule against marrying a sister or other relative, yet. There was no need for this rule. The reasons close relatives shouldn't marry now is because any genes for diseases or something would be doubled. This is why certain breeds of dogs get certain diseases that are common for that breed. They are all related, in a small gene pool, and the bad genes accumulate.

In the beginning, when God made Adam and Eve, the genes would have been pure. There was no reason medically, spiritually or culturally against marrying a sibling.

In fact, all through the Old Testament, people went to their home town, to their relatives, to find a spouse. Abraham was married to his half sister, and by then, there were many women to choose from.