I actually wanted to post the same question since this issue has been bothering me for a long time, but I found this post (and lots of duplicates), so let me just add my 2 cents here.
I think we have a huge problem with people writing answers in comments, and it happens all the time, both on MSE and on MO.
Several (bad) reasons for writing answers in comments
In many cases, a question can be answered with one or two sentences. In these cases, some people prefer to write their answer in the comment section, because they assume that an answer has to be longer, including lots of details, references, proofs. This assumption is not correct, of course. An answer should be posted as an answer, regardless of its length. When the OP needs further assistance, the answer can be expanded later on.
Sometimes these answers in comments are just small hints that are supposed to help the OP to find an answer on their own. However, I have seen again and again that these hints are actually just "quick thoughts" which might eventually be misleading and not helpful. Here, the commenter did not take enough time to write a full answer and hence (ab)used the commenct section for this piece of (sometimes bad) advice. In these situations the comment section might evolve into a full discussion, including several further questions by the OP. This goes against the fact that MSE is not a discussion forum, it is a question-answer site.
I also observe that many commenters prefer to write an answer in a comment because they think that the question is trivial. They don't want to be bothered to write a full answer which actually helps the OP. They ignore that, what is trivial for them, might not be trivial, actually very hard to understand for the OP.
It also happens quite often that answers are written in comments when the question is likely to get closed, for example because it is a duplicate or of bad quality (or too trivial, as in the previous paragraph). In these cases, there is a general recommendation to not write answers. But it seems that many people don't understand that this recommendation of course also applies to answers written in the comment section.
What we can do?
In case the comment contains a proper answer, I often ask the commenter to post their answer as an answer then. It does not always happen, though. Sometimes, in particular when I have asked the question myself, I then write a CW answer myself, copying the comment into it, so that I can mark the question visibly as answered.
Personally, I think that we need to have a better solution here. For the start, it would be good to have a reference (EDIT: the Help Center and Meta/19756 already provides such a reference) where it is explained clearly that and why answers should not be written inside of comments. Maybe accompanied with a teaser text that links to this reference. Then we might be able to copy paste this text.
Let me start something that may be copied (edits are welcome!):
This is an answer to the question, not just a comment. Comments should only be used to clarify, not answer the question. See How do comments work for more information. Therefore, please post your answer as an answer. This brings extra visibility to the answer und puts the question off the unanswered list. Also notice that comments are not indexed by the full text search, don't have any revision history, can only be edited for 5 minutes and allow only limited markup.
But in the long run, this will not change much, since there are a lot of poeple who are new to the site and just do not know this recommendation. To new users, there should be a popup before they are submitting a comment. Alternatively, there should be a flag option for comments, saying that it is actually an answer.
Update: I have copied this message now under several "answers in comments"-type comments (of which I see about 10 per day). Not sure if it helps, let's see. Example.