The main relevant biblical passage is Matthew 22:23-33, where Jesus is asked by the Sadducees about a woman who had married several men. They challenge Jesus to answer whose wife she will be after her death. He responded by saying, "You are wrong, because you know neither the Scriptures nor the power of God. For in the resurrection they neither marry nor are given in marriage, but are like angels in heaven." There will be no marriage in heaven.
Nevertheless, this answer is not easy for many modern Christians to hear. People think: "But I could never imagine being without my spouse. How could I have joy in heaven apart from my love?" To be blunt, a person thinking this way is committing idolatry. Essentially, he or she is saying that Christ is not enough. I still need my spouse. Randy Alcorn's answer to this question is very helpful, which centers his response on Christ (taken from Eternal Perspective Ministries):
In heaven there will be one marriage, not many. That marriage will be what earthly marriage symbolized and pointed to, the marriage of Christ to his bride. So we will all be married—but to Christ. To have a lot of marriages in heaven would be like still offering sacrifices after the Lamb of God came and offered the ultimate sacrifice. Our marriage to Him is the true Marriage, of which the best of earthly marriages was a symbol and shadow. Those who did not experience marriage or had only a poor marriage on earth will be delighted with their eternal bridegroom, who has already gone to prepare a place for them. One day all heaven will attend the ultimate wedding, and we will be his bride (Read Rev. 19:7-9).
However, I do envision that people who have had important roles in each others' lives will continue to be friends—and that would include a lot of people who've been married. If a woman was married to a man, he died and she married another man I think she could have a meaningful deep friendship in heaven with both.