Always two words.
Non-hyphenated when used as a noun: Dominique Wilkins capped off the Hawks’ victory with a vicious slam dunk.
Hyphenate when used as an adjective coming directly before a noun: He seems like a slam-dunk candidate for the coaching vacancy.
