The primary passage in Scripture that forbids marrying close relatives is Leviticus 18:6-18. The following is a comment on this passage from the “Bible Knowledge Commentary.”
18:6-18. The general principle of this section is given in verse 6: Do not have sexual relations (the Heb. uses a euphemism trans. lit., “to uncover the nakedness of”) with any close relative other than your spouse. The primary thrust of the passage is to forbid illicit marriages, as the prohibition against adultery was assumed (cf. v. 20; but contrast Harrison, Leviticus, p. 186). Also assumed is the prohibition against marrying a non-Israelite (forbidden in Deut. 7:3-6; cf. 1 Kings 11:1-2). However, if a non-Israelite (as Ruth) converted to the Lord, marriage was permissible.
The following regulations can be gleaned from this section. A man could not marry his mother (Lev. 18:7) or his sister (or half-sister; first degree of consanguinity according to modern genetics, v. 9). Prohibition of marriage to one’s daughter was assumed and so not mentioned (cf. Gen. 19:30-38). Nor could he marry his granddaughter (second degree of consanguinity, Lev. 18:10) or his aunt (father’s or mother’s sister, vv. 12-14). Also forbidden were marriages to a widowed wife of a close blood relative, that is, a man’s stepmother (v. 8), half-sister (v. 11), aunt by marriage (v. 14), daughter-in-law (v. 15), sister-in-law (v. 16), step-daughter (v. 17), and step-granddaughter (v. 17). The apparent reason behind these prohibitions against marriage to those with such an in-law relationship was that they had become “one flesh” (Gen. 2:24) with the blood relative, and so were regarded as a part of the larger family unit (cf. Wenham, Leviticus, pp. 254-8, for specific examples of some of the more difficult identifications).
In the time of Adam and Eve, such close unions were perfectly safe genetically, even though later the accumulation of genetic mutations over many generations would make them sufficiently dangerous so that actual legal prohibitions against incest (Leviticus 18:6) had to be imposed by God. Nothing, of course, is mentioned about 4th and 5th cousins which would not be considered a close relative.
You might also be interested in this comment from “The Bible Has the Answer,” by Henry Morris and Martin Clark.
In later generations, brother-sister marriages would come to be recognized as genetically dangerous and would be prohibited as “incest.” Not only the Bible but also most other legal codes refuse to sanction marriages of close relatives. The scientific reason for this restriction is that children of such marriages are more likely to be deformed or sickly or moronic than those of other marriages. The genetic basis for this probability is that inherited mutant genes, producing such unwholesome characteristics, are more likely to find expression in the children if they are carried by both parents.
You might also check out www.probe.org , a site that deals with a lot of social issues from a biblical standpoint and position.