There are quite a few questions related to overstaying visa, working illegally without proper visa, etc.
How should questions and answers suggesting criminal activity be treated here?
Such questions should be considered on a case-by-case basis. Some should be answered, others not. The rule of thumb is that we want to be "on the side of angels" in such situations.
Suppose someone asked, "I did such-and-such that I now believe to be illegal, what can I do to make it right?" That is the kind of answer we want to give, to be helpful, assuming that a satisfactory solution does, in fact, exist.
Another acceptable question might be, "I did such-and-such, that seems to be illegal, because I did it a certain way, but my understanding is that it would have been perfectly legal if I had done it the right way. What SHOULD I have done to make it legal?" Here, an answer might help the OP, but even if it doesn't, it would be useful if it helps the next person act legally.
The kinds of questions we should not answer are something like "I'm doing such-and-such, I think it's illegal, how can I cover my tracks so I don't get caught?"
Stackexchange's content policy does state that the site can't be used for illegal purpose, and a while back we made a decision (can't find it right now) that questions about how to do illegal activities would be closed.
The grey area comes in a couple of places:
Of course, we're also not lawyers, so mistakes may happen, but we can only do our best. If you're not sure, flag it for a moderator and they can certainly look at it.
Downvote me to oblivion, but personally, I'd leave them open. Discussing illegal behavior is not illegal per se. For this reason, I believe that the SE content policy does not prohibit them.