When is it okay to post two answers to one question?
When you have two distinct answers.
It's better to post two different answers than to put them both into one answer.
Some questions will be multiple-answer types directly, like polls, tips-and-tricks or best-practices. This allows the ones the community feels are the best/correct to float to the top.
Some computer languages have a lot of flexibility in how to solve any one problem, so by listing them both as separate answers (if very distinct) they can both be voted on by the community, and this will allow the better answer to float to the top. It also allows the comment threads to be more focused on each answer.
If you put two very different answers in one, then one could be a great answer, and one could be a terrible way to do things, but the upvotes (or downvotes) on the good (or bad) answer will drag the other along with it to the top (or bottom).
If it is possible for a question to have two valid answers from the same person, the odds are high that it's a bad question.
(in other words, it's a poll question.)
In general there should be one answer per person per question; if you need to amplify your answer, edit it!
When they offer different approaches to the problem?¨
Sometimes one answer may be directly related with the problem the user is asking.
Other answer may be something that you suggest as an alternative.
For instance, "How do I shoot my self in the foot with C++"
1st answer ... .First you do #define if while etc. etc
2nd answer ... Why use C++, you can use ( this, and that, and the other )
There always can be two answer for the same question ( specially when is vague )
I have already had a couple of "real" (e.g. not a poll or fluff or humor) questions where I answered with 2 or even 3 solutions, explaining the reasons to pick each one. And i'm a relative newbie on SO (only 4k rep).
One place where this situation is especially likely to come true is Perl (aka ThereIsMoreThanOneWayToDoIt language).
While I usually squeeze all my ideas into a single post in such situations, I greatly appreciate the ability to NOT put them in one basket, so to speak - e.g. when I feel that posting one of the answers is education and adds to the site's useful content, yet the other one is "more deserving" (e.g. cuter/more elegant) and you don't want the up/down votes from one to affect the other.
I can't think of a good reason for doing that, except for polls, which are not welcome (except occasionally on meta sites).
If you have two solutions to the same problem, post them in a single answer. Explain when you would use this solution and when you would use that solution. This is better than two separate answers that don't address when to use each solution. For example: “If you have version 1, do <this>. If you have version 2, you can use <this simpler solution> instead.”