First and foremost, it's never okay with Blizzard. Your account will be perma-banned if they find out. If you're okay with that, keep reading.
The only situation I've seen that really works: I had a friend who rolled a character on her boyfriend's account while they leveled to 80. They had different work hours, so they could play while the other was out, and they only logged onto their own characters when they played.
Once they hit 80, they wanted to do endgame stuff together and she got her own account and transferred her character to it. (I advised her to do it and told her how, but they made the decision.)
Tips for Chronic Sharers
Never join a guild without informing them that you share your account and who with. Some guilds will reduce your permissions if your partner in crime isn't a member, and other guilds won't let you in at all. Being upfront about this will keep your guild from kicking you when they find out the hard way. (Guilds -- always ask applicants if an account is shared.)
If you share a single character with someone, always be clear about who you are when you speak. Even if you've already said it in gchat, repeat it if you whisper anyone. This prevents confusion.
Never expect to be made an officer. No guild wants a non-officer to have access to officer capabilities, and for good reason (non-officers on shared accounts can see sensitive info in officer chat, loot gbanks, or gkick people they don't like).
You are always responsible for what someone else does on a shared account -- whether you have to explain yourself to a guild, a friend, a server, or even Blizzard, everyone on the account must face the consequences of mistakes made on that account. "It wasn't me!" is never an excuse.
Don't be surprised if your shared account causes problems, confusion, or drama. In fact, expect it.
If you decide sharing isn't worth it and you want to split an account, you can transfer characters from your current account to a new one if the payment information on both accounts match. Info here. (Having the same payment info does not mean both accounts must have the same user name. My husband and I have the same payment info but I have a different user name than he does.)
Account sharing has many more cons than pros. In the long run, it's better to pay for two accounts than to get banned and lose all the subscription money (and progress) you've spent on the one. Account sharing can be practical in a very few scenarios, but it never stays that way. Eventually, you'll find yourself with more problems than solutions.