The two types of questions involved are polar questions and alternative questions. Polar questions are questions that have only 'yes' or 'no' answers. They can be seen as having the following logical form:
where p is a proposition that can be true or false. To ask such a question is to ask for the truth value of p. Thus a question such as:
Do you jog?
can be seen as asking whether the proposition that you jog is true.
Alternative questions, on the other hand, are questions that present a set of mutually exclusive options, and whose answers must pick one of these options. You can think of such questions as having the logical form:
Which one of p, q, r, ..., is true?
The question presupposes that one of p, q, r, ..., is true, and the answer should specify which one. Thus a question such as:
Is it Friday or Saturday?
Can be seen as asking which of the propositions It's Friday and It's Saturday is true, presupposing that one of them is.
The kind of joke you mention exploits the syntactic ambiguity that arises in some cases of alternative questions. Since the word or can be used both to specify alternatives and to form a disjunctive proposition, questions such as the following
Do you jog or bike?
can be interpreted syntactically in two ways:
Is it true that you jog or bike? (polar question)
Which of the following is true: you jog, you bike? (alternative question)
The first asks about the truth of the proposition you jog or bike, so must get a yes/no answer. The second asks which of the two propositions is true, so must get not a yes/no answer but a jog/bike answer. The joke of course is that you interpret what is clearly intended to be an alternative question as a polar question instead.
In general, questions with the form p or q are typically intended as alternative questions, but sometimes they can be reasonably intended as polar questions about disjunctive propositions. For example, using the question
Do you eat meat or fish?
the questioner might try to find out whether you are a vegetarian, intending this to be a yes/no question.