We first need to ask what is meant by "okay." If okay means entry or exclusion from heaven, I want to be very clear: getting a divorce or staying married has no baring on entrance to heaven or hell or one's ability to pray to God. Even one sin without Christ's grace will keep a person out of heaven. Faith and surrender to Jesus Christ, who he says he is, and in his death and resurrection dictates entering heaven or being cast to hell. This is the key to entry in to heaven, not any work, like staying married. Without Christ, even one sin is "not okay." However, we all sin (act in ways that are contrary to God's wishes for us), a lot. If we need to discuss this in more detail, please feel free to contact me.
So then the real question is if you were considering divorce, and God were sitting with us having coffee, how would he advise you in your situation. If this is you, I recommend you put lots of time to honest prayer, just as if he were sitting with you having coffee. Ask him what you might do to improve your marriage. Ask him to show you areas in your own life that may need repentance. Ask him how you can show your spouse grace. Ask him to fix your marriage. After you've had that conversation for a while, and if you feel that his involvement and advice is making no difference, ask him why. If you are already praying about this, pray more.
In the Bible, God presents his ideal. His ideal is that people remain married. And if not for humanity's ugly brokenness, we'd all meet this ideal with little effort. But because of the mess that we are, we have to work at it--some much more than others. The entire Bible is full of stories about people trying to work together in some kind of relationship. Paul writes letters to entire churches trying to help them have healthy relationships in work, play, marriage, etc. Obviously, it's hard and it's messy to meet this ideal.
God wants us to meet his ideal, but we won't, we can't. We are too messed up. This is why Christ died. So now we can find grace in our mess, through Jesus.
The overly religious people of Jesus' day, the Pharisees, came to Jesus and asked him if it was okay for anybody to get a divorce. (You can read about this in Matthew 19:1-9 and Mark 10:1-11.) Here's how it went down (I'm greatly paraphrasing):
Religious people: Is it against God's Law to divorce your wife for any reason?
Jesus: Haven't you read the Law? [He's referring to the Scriptures, specifically to what the Jews called The Law, the first 5 books of the Old Testament, written by Moses. These 5 books include lots of stories; it is not just a book of rules like we think of the law today]. God created men and women to be together. A man should leave his family and get married. He should hold fast to his wife. [Paul once wrote that a man should love his wife like Christ loves the church, and Christ died for the church!] God has joined them together so nobody should separate them. (See Genesis 2:24, Matthew 19:6, Ephesians 5:23-33.)
[Jesus pointed out the ideal and expressed that it should be taken seriously.]
Religious people: Oh really, than why did Moses say a man can divorce his wife? [They were trying to trap Jesus or demonstrate that he was teaching counter to the Scriptures.]
Jesus: It's because you have a hard heart. [This is his way of pointing out our ugly, brokenness.] But it was not intended to be this way from the beginning. But you should know, anyone who gets divorced outside of infidelity will commit adultery.
Jesus also explained that even the very act of looking with lust at another person is committing adultery with that person (Matthew 5:28). I am not saying that committing adultery is okay with God; in fact, the opposite is true and society's definition of adultery and God's definition are quite different. However, you should understand how it's being discussed in the Bible. And ultimately, the religious people were asking if a person will still be okay with God if they got divorced. Jesus is our intermediary so we can always be right with God through Jesus, divorced or not.
That being said, divorce is against the ideal; it's against God's desires for us. God hates divorce (Malachi 2:16). The Bible teaches that we should not take the matter lightly; and if you are considering divorce, you should try at all cost to work through the messiness.
Maybe this is not the answer you wanted to hear, and that's okay. I realize I didn't give a simple yes or no, but that's because it is not a simple matter. I suggest that you go back to that table at the coffeehouse and talk with God often. Read his Word in the Bible. Pray. Communicate with your spouse. And pray together.
*Photo taken by Flickr user, jcoterhals, is registered under a Creative Commons license.