A happy ending massage is a massage that ends with some sort of sexual stimulation and oftentimes orgasm, hence the "happy ending." Manual stimulation of the genitals and oral sex are most common at the end of a happy ending massage, but sexual intercourse is not unheard of.
A happy ending massage may occur between a monogamous couple, but it is often referred to in the context of an erotic massage parlor, where female masseuses provide this extra (although illegal) perk.
A happy ending massage may also be known as an erotic massage or sensual massage.