English common law created a disincentive to suicide by holding that any property owned by a suicide was forfeit to the Crown – in other words, by committing suicide, a man would be leaving his family destitute. Presumably this was less effective as to women, children, and the poor.
In modern times, there are no such penalties (except for the possible forfeit of insurance benefits, as already discussed), so there are no direct legal consequences to suicide.
An unsuccessful attempt at suicide can have legal consequences, however. I believe that such an attempt can in itself be a basis for involuntary civil commitment, at least for some specified period of time.