confirm-kill-emacs is a variable defined in `files.el'.
Its value is

How to ask for confirmation when leaving Emacs.
If nil, the default, don't ask at all. If the value is non-nil, it should
be a predicate function; for example `yes-or-no-p'.

You can customize this variable.

This variable was introduced, or its default value was changed, in version 21.1 of Emacs.