I just saw a question in which the same user answered twice. The two answers are however slightly different. Why is this possible and is there a limit to the number of answers one can give?
It's a feature, not a bug. Users are allowed to write more than one answer; each time they do this, they get a dialog box that asks they are sure they don't mean to edit their previous answer.
Apart Community Wikis, there are cases where answering more than once makes a sense.
Suppose that somebody is giving two different options as an answer to a question. If both the options would be in the same answer, who agrees with an option, but not with the other one, would have some problems voting the answer (+1 for the first option, −1 for the other option; the total is: no votes); if the options are separated in two answers, it is easier giving a vote, and it is easier for who see the answers understand what the community thinks (e.g. both the options are valid, one of the options is very bad).
Clearly, as the dialog box reminds, the second answer could be avoided, especially if it is the carbon copy of the first answer, with some changed words. In that case, it is better to improve the existing answer, as the new answer doesn't add anything new.
Both answers were originally the same; he only edited one of them later, without bothering to delete the other one. So I trashed the other one (and berated the author for not already deleting it himself -grumble-).
Now, I don't understand why there isn't a limit in place to prevent identical double-posted answers, since there's no reason for anybody to post two identical answers besides accidentally clicking submit twice. (Twitter has such a safeguard against duplicate tweets, which is pretty effective against spam and accidental double postings.)
It's fine to provide more than one answer to a single question provided the answers actually differ from one another, of course.
I do not believe that there is a limit. As long as your answers are valid and don't attract any moderator flags for abuse. However I think that this behavior could be viewed as gaming the system as each answer can be voted on separately hence doubling the chances of upvotes for a user (if both the answers are valid). IMO, If you have two solutions then list them both - there is really no need for two answers.
It would be recommended to simply add details to your original answer though - adding more details, adding an "alternative solution" header and detailing your additional solution there...etc...