Is "congratulations" a sentence, and if so, why?

Solution 1:

"Sentence" doesn't have a fixed formal definition: it may mean anything from 1 "a pragmatically meaningful utterance" at one extreme through 2 "a formally complete clause" to 3 "any string of written text lying between an initial capital letter and a full stop, question mark or exclamation point".

Both

Congratulations! and
Congratulations to the winner of the big contest.

would qualify under the first and third definitions, but not the second.

Solution 2:

An often used diagnostic for the category of a constituent is coordination with "and". Generally, but with some exceptions, only constituents of the same grammatical category can be coordinated with "and". It's easy to think of examples where "Congratulations" is coordinated with an imperative sentence -- "Congratulations, and have a great time at Niagara Falls!"

So I classify it as an imperative sentence. Probably, it's short for "Accept my congratulations!"