Inspired by this question are there any recorded jokes in the works of the Geonim or Rishonim? Please cite sources
While your question is overly broad, the short answer is "yes" - at least so far as Rishonim are concerned, and only because I don't know of any examples from geonim. (There are numerous examples of humour being employed in the Talmud, but that's beyond the scope of what you asked).
There are two famous examples from Ibn Ezra, who lived from approximately 1089-1164 and who composed a couple of commentaries on the Torah. In Exodus 21:35, he takes issue with the opinion of a Karaite scholar named Ben Zuta, who held that the noun רעהו ("his friend") had שור ("ox") as its referent, and that rather than providing a scenario in which one man's ox gores the ox of another (literally, "the ox of his friend"), Ben Zuta suggested that the injured ox was the friend of the one that gored it. In responding to Ben Zuta, Ibn Ezra gibes that the only friend that oxen have is Ben Zuta himself (ואין לשור ריע רק בן זוטא לבדו).
Similarly, in Genesis 29:17, Ibn Ezra takes issue with a Karaite scholar named Ben Efraim who suggested that the description of Leah's eyes as being "soft" (רכות) was missing an alef, and that it should say "long" (ארוכות). In response, Ibn Ezra suggests that it is Ben Efraim who should be missing the alef and that his name, therefore, be בן פרים ("son of cattle"). That these statements are humorous might seem obvious, but for an explicit assertion to that effect, see Avi Ezer on Genesis 15:11.
Humour, of course, doesn't have to be used for the purpose of mockery. One particularly famous example where it is not used in such a fashion (and depending on whether or not you consider him a Rishon) is in the Rema's response to an assertion made by the Bet Yosef in Yoreh Deah 87:3. There, R' Yosef Karo points out that one should be careful not to mix fish with milk, since the combination is a dangerous one (אין לאכול דגים בחלב מפני הסכנה), and cites Orach Chayim 173 as a support. The problem is, the Tur in OC 173:2 makes this statement as regards fish and meat.
It has long been suggested that the reference to milk in YD 87 is a typo, and an easy one to make when you consider that "meat" and "milk" are often used in connection with one another. The Rema (Darkhei Moshe, ibid.) suggests as much, but does so by way of what surely must be considered a joke! After mentioning that he has never heard of the tradition of avoiding admixtures of fish and milk, and after noting that the passage referenced by the Bet Yosef mentions fish and meat, the Rema concludes that the Bet Yosef appears to have mixed meat and milk (ולכן נראה שנתערב לרב בית יוסף בשר בחלב).
ואמרו על הרב מהר"י אבוהב ז"ל שהיתה עינו אחת סמויה...פעם אחד היה מהלך בדרך בשדה וישב לו הרב על שן סלע אחד, וב' נכבדים ישבו אחד מימין ואחד משמאל, והיה בחור אחד תלמידו עומד לפניהם, והרב ז"ל בדיחא דעתיה והיו מדברים בדברי צחות, ופנה הרב אל התלמיד ואמר ליה אמור אתה, א"ל תן לי רשות שאשב, א"ל שב, ישב על האבן ואמר על אבן אחת שבעה עינים
And they said about Rabbi Mahari Abuhav OB"M that one of his eyes was blinded...one time he was walking on the way in a field and sat on a certain rock outcropping, and two honored [companions] sat on his right and left, and a certain young student of his was standing in front of them. And the Rabbi was feeling humorous and they were telling jokes, and the Rabbi turned to the student and said, "You tell [a joke]". And the student said, "Give me permission to sit." And he said, "Sit!" He sat on the rock and said "Upon one stone are seven eyes!"