You're asked about it in both your application for an airman's certificate (the physical) and your security clearance, at least for the SF-86. As someone stated above, you MUST tell them about it; it's easy to find in records and will make you look evasive or dishonest if you keep quiet.
As to whether it'll affect getting hired, it depends on what it was for. Obviously they let some crazies in, because Raydon's made it. Visits following significant life events (death in the family, for example) are commonplace and won't cause any problems. If you've been diagnosed with a mental disorder, however, you may run into some serious problems.
I agree, ask the Flight Surgeon here with the specifics of what your visit was about (if you're comfortable with that, of course... you are relatively anonymous, being online and all). The requirements for a second class certificate are the same whether it's obtained by a pilot or a controller.