What is it called when an incorrect homophone is used for humor?

Solution 1:

As @Mitch correctly states, it's called a pun.

The pun, also called paronomasia, is a form of word play that exploits multiple meanings of a term, or of similar-sounding words, for an intended humorous or rhetorical effect. ...
Wikipedia