I would call that cerebral humor. Dennis Miller is fairly cerebral.

Merriam Webster (above link) even uses that as an example usage of the word.

He's a very cerebral comedian.


Consider highbrow humor. Oxford Online defines highbrow as

Scholarly or rarefied in taste


Wit

a natural aptitude for using words and ideas in a quick and inventive way to create humour: -ODE

Witty jokes usually need some intelligence to get (and make for that matter).