1 Corinthians 7:15 (ESV)

15 But if the unbelieving partner separates, let it be so. In such cases the brother or sister is not enslaved. God has called you to peace.

Only if the unbelieving spouse does not want to continue living with the believing spouse will it be right to separate. The believing spouse is enslaved (bound to stay in the marriage), only as long as the unbelieving spouse is willing to stay.

One implication of this verse is that the believer must do everything that can be done on his (or her) side, to make the marriage work. These efforts should be motivated by God’s calling: God has called you to peace.