What can I gain from answering questions on the Stack Overflow website?

If you share your SO login handle with a prospective employer they can use it to judge your expertise.

Of course that can backfire if you are prone to writing low-quality or un-serious answers to things. Also if you do it too much; someone might question why you have that much time on your hands.

This assuming you aren’t community minded. As in: “people helped me when I needed it and didn’t ask for anything so I want to give back now that I can.”