A pun (paronomasia is a rarer name for it) is a "play upon words" - that is, it is a joke (or at least is usually meant to be funny) which relies essentially on the fact that two words with different meanings sound the same. More technically, we can say that two homophones are deliberately confused. For example, "It's raining cats and dogs, and I've just stepped in a poodle" (not a puddle); "When she saw her first white hair, she thought she would dye" (i.e. add artificial colour; but sounding as if it were 'die' ~ 'cease to live' - implication, that the speaker was so ashamed).
There are sites on the internet that will supply endless puns - http://www.punoftheday.com/ for one. Many people love punning; others hate it. Dr Samuel Johnson's Dictionary defines a punster (a person who makes puns) as "A quibbler; a low wit who endeavours at reputation by double meaning"; and it is often said that a "Pun is the lowest form of humour" (though many things are said to be the lowest form of humour, including sarcasm).
Other forms of playing on words exist, as exemplified in the riddle "Why did the butterfly flutter by?"/"Because she saw the dragonfly drink the flagon dry." (See spoonerism.)