Is it possible to execute a function or command at a specific time? As an explicit example, is it possible to kill emacs at a specific time (time determined by the OS).
You want to use the function
run-at-time, described in Chapter 38.10 of the Emacs Lisp manual. In your case, something like this should do the trick:
(run-at-time "20:30" nil #'kill-emacs)
If the function you want to call takes parameters, you can specify them as additional parameters to
(run-at-time "5 sec" nil #'message "Tempus volat, hora fugit.")
Note that absolute times are taken to be today, even if they are in the past, so the first example above will exit immediately if it is after 20:30.