I met the earliest known joke, e. g. here: https://m.reddit.com/r/AskHistorians/comments/1e5qdi/the_worlds_oldest_jokes/?ref=search_posts,but these are far from being funny. Would we consider a joke from Roman times or the Middle Ages humorous?
I've read ancient comedies and I have to admit it's not so fun.
It is like hearing jokes in a foreign country, often you don't even know how it is even funny. You don't know the cultural references, the cultural codes on what can be ridiculed, you have no idea of the running jokes.
There is not a specific time in the past when all jokes start being understandable to us now. Instead, a joke remains fun as long as its subject is still around. In greek comic Aristophanes, I get a joke like "– I'll pay all the money the crew of the ship after the journey –You'll bring relief to many sorrowed asses". But in the 80's movie "Airplane!" there is a joke on Gerald Ford I don't understand anymore.
FYI, there's an old thread of miscellaneous jokes through time in the FAQ. It includes several from Ancient Rome, and one or two from the Middle Ages, among others