From the late Middle Ages we have many examples of jokes thanks to Poggio Bracciolini, who compiled a book of them, known as Liber facetiarum, id est Book of funny stories. The jokes therein comprised are really good, although some were funnier in context. I'll translate for you my favourite one, to give you a taste of misser Bracciolini.
One of our fellow nationals, a not so bright one, and inexperienced in the matters of love, got married. One night in bed, his wife turned her back on him, who was stunned at the gesture. So stunned he was, that he asked his wife if she had two of those things, and having her said that she did, he answered: "Oh, oh, one is enough for me, the other is too much". Then, the woman, wittily, as her priest was also her lover, said: "we can give the other in alm to the Church, and to our priest, for he'll have great pleasure with it, and you shall not be offended, as one is enough for you". The man agreed, in order to take that weight off his shoulders, and to please the priest, who he liked. And so, having invited him to dinner and told him the case, the three went to bed, the husband on the front, and the priest on the rear so he enjoyed the gift. The priest, hungry for that desired prize, attacked first; seeing that the woman was making some noises, the husband feared the priest would get into his territory: "Oi, friend, stick to your side and leave mine alone". "God help me", said the priest, "I don't care much about yours as long as I can enjoy the Church's goods". With these words the idiot got calm, and invited the priest to freely enjoy his wife on the part she had given to the church".
There are a whole lot of very dirty jokes. I don't know whether there is an English translation of Poggio's facetiae, as I read them in Italian from this edition:
Bracciolini, Poggio (1912). Facezie di Poggio Fiorentino, introduzione di D. Ciàmpoli. Lanciano: Carabba.
Those are not the only surviving jokes from the Middle Ages, there are hundreds more, like the ones present in the Libro de Chistes, by Luis de Pinedo, or the early moder "Cancionero de obras de burlas movientes a risa (Valencia, 1519). The famous Galician-Portuguese cantigas do contain some raunchy or saucy poems (Quatro caralhos being my own favourite), and they are not alone in that regard.
There actually is an ancient Greco-Roman joke book called the Philogelos ("Laugh Lover") and I would classify the jokes within as pretty similar to the sort found in modern joke books, and about as (un)funny. Here is a nice collection of a few of them taken from a recent translation, this is a good example of one that is basically a Bob Hope joke:
"A wife-hater is attending the burial of his wife, who has just died. When someone asks, 'Who is it who rests in peace here?', he answers, 'Me, now that I'm rid of her!'"
And one that I swear could be in a modern book:
"An incompetent teacher is asked the name of Priam's mother. At a loss, he says, 'Well, we call her Ma'am out of politeness.'"
As for humor in general, it kind of runs the gamut. Aristophanes is maybe the most popular ancient writer of comedy today because his works have a nice mix of social and political satire with a lot of poop and dick jokes, and the Greek New Comedy style which followed it has a sort of romcom/sitcom feel to it. I don't think there is any way to generalize it, although I think modern readers tend to find some of it pretty mean spirited.
Graffiti also deserves a mention, I am honestly not sure how reliable that list that goes around the internet is, but there are definitely plenty of well attested bawdy jokes. Short scratchings on sling bullets is also a great source of some pretty pitch black humor, a Greek one I really appreciate says "Catch!"
EDIT: I should probably clarify about the Pompeii graffiti list, all of them (as far as I know) are sourced from actual entries in the Corpus of Latin Inscriptions, however the translations provided can be pretty free. To take the best one from the list, CIL IV 3932:
Weep, you girls. My penis has given you up. Now it penetrates men's behinds. Goodbye, wondrous femininity!
The actual Latin (taken from this site) is:
IC RVFVM KA(R)VM (...) DOLETE PVELLAE PEDI(CO) CVNNE SVPERBE VA
Which more directly translates to:
Here I screw dear Rufus. Mourn, girls! Farewell proud vagina!
Basically the same sense and still very funny, but you can see considerable liberty was taken with the more common translation.