Ooh! I know this one!
Jokes are probably as old as language itself. The oldest recorded joke book (well, joke tablet, really) dates back 3900 years. The oldest 'yo mama' joke is 3500 years old.
There are other jokes from that tablet here. Some of them still hold up quite well.
This is older than the Ancient Greek comedies by over 1000 years, although the humour in those has held up better, in my opinion.
It's also older than some of the puns in the Bible ("Thou art Peter. On this rock (petra) I build my church" - from memory.)
EDIT: If you're interested, as far as I'm aware the first "yo mama" joke in modern English was in Titus Andronicus by William Shakespeare.