Including a joke in an otherwise correct exam answer as the student I just read Ethics of awarding points for hilariously bad answers, and it reminded me of my Senior History exam in high school. I was confident in my knowledge and noticed that I had a lot of time left for the second half of the exam (the part where we were allowed to use our historical atlas), so during this second half, I often included a short joke comment between parentheses after the otherwise correct answer. For example, one of the questions I remember asked something about one of the European invasions of WW2, and after the answer itself, I joked about how it wasn't the first time they were conquered and listed a couple of other times they were conquered, like by the Greek, the Romans and a couple other groups I can't quite remember. I think I gave about half a dozen or a dozen jokes like that after relevant, for no other reason or justification other than because I felt like it.
My teacher afterwards told me she found it quite funny to grade my exam, though I cannot really remember anymore whether she adjusted my grades because of them. I don't think she detracted any points and while I can't remember for sure, I think she added a couple percentage points because I showed knowledge of the subject matter beyond what was required. Again, I just did it because I felt like it, though I'm uncertain whether I was influenced by remarks from a substitute teacher that they liked to laugh at absurdly bad exam answers in the teacher's lounge (again, high school, and in a special education school at that).
Now, obviously I didn't do this with the intent of getting a better score or something like that. I just did it because I felt like it, autistic brains are weird like that. But I'm wondering: Assuming an answer that's correct as far as you know, could it be a problem as a student to add a relevant joke to an otherwise correct answer? Could it impact the immediate and/or long term evolution of my grades, education and professional/academic life beyond just this exam, whether negatively or positively?
As I understand, your main question is:
Could it impact the immediate and/or long term evolution of my grades, education and professional/academic life beyond just this exam, whether negatively or positively?
Immediate grade: Obviously. People might have different rules on how they grade. Graders are usually humans who are impacted conciously and subconsiously by their students' actions (and how they speak, look etc.) One teacher might like you more for making jokes, one might be angry that you wasted their time, one might not find the correct answer because you wrote too much irrelevant things etc. One might not care. In grading, almost everything is possible.
Long term evolution of grades, life: Most likely not. If you have one teacher in different courses who likes you or doesn't like you because of jokes, this might play into other exams. However, usually, after a course is over, if at all, people care about the grade you got and not why you got it. It's unlikely that anyone will see the exam after the end of the course.
If you get extremly famous, it might be a nice episode about you that you made jokes on exams. Or not.