The ATF 4473 uses the phrases "adjudicated to be mentally defective" or "ever been committed to a mental institution". I take that to mean a court would have to been involved or some sort of stay at a mental health institution. The instructions say if you've been discharged by them you can answer "No" on the 4473.
I interpret that to mean just seeing a 'shrink' doesn't count.
I believe he state of Colorado uses the ATF 4473 as their background check form.