In general, questions in English must include one of the following:
- a helping (auxiliary) verb, such as have, will, and would,
- a form of the verb be,
- or a form of the verb do as an auxiliary verb, if neither of the above is present. In this case, the main verb is not modified by the subject or tense. "Does she drive?" is correct, while "Does she drives?" is not. "Did she drive?" is correct, not "Did she drove?"
In any past tense, the helping verbs are simply conjugated in the tense desired, such as did, were, was, had, etc.
Let's apply these rules to your examples.
How many pegs did you have?
This is correct, because it includes the helping verb do in past tense.
How many pegs did you drink?
Also correct, for the same reason as above.
How many pegs you drank?
This is incorrect; it does not have either a helping verb, a form of be, or a form of do. It is actually corrected by the sentence below it.
How many pegs have you drank?
This is correct, since the helping verb have is present, and drink is correctly put into the past participle form drank. This is how the sentence above it should read.
How many pegs you have had?
This is close, but the subject and verb should be inverted to form "How many pegs have you had?"
Declarative statements use "there are":
There are some clouds in the sky.
Questions reverse the order:
Are there some clouds in the sky?
In sentences such as "Do you know how many apples there are?" the phrase "how many apples there are" is not a question itself, it is a subordinate noun clause. The word order reversal comes in at "Do you know" (where a declarative statement would say "You do know").
Best Answer
Both "many" and "much" can be used, depending on context.
This is because "fish" can be countable or uncountable, depending on the definition in use. Refer to these definitions (from Oxford Dictionaries):
Note: "Mass noun" means the same as "uncountable noun."
Your sentences are both correct and are likely to be understood, although #2 ("much") does, to me at least, sound a bit odd. They could be interpreted as follows.
A question about the number of individual fish caught. You might reply with a number ("five"), or you might specify the species of fish caught ("two cod and three haddock").
A question about the weight of fish caught, not the number. You might reply with a single weight ("three kilos"), or (again) it could be split by species ("one kilo of cod and two of haddock").
The interpretation changes slightly in other contexts, but remains largely the same. Consider the following sentences:
Probably an odd question for large fish, but perfectly reasonable for whitebait or other small fish where multiple are eaten at a time. If a larger fish was involved, you'd be more likely to ask:
A normal answer could be "the whole fish" or "half the fish," if you were being served a large fish. You wouldn't ask this for fish like whitebait. You could, technically, specify a weight here, but I would expect it to be much more likely for a fraction of the fish to be given instead.
Of course, if you were being offered more than one large fish, it makes more sense to use "many" because then the question is about multiple discrete fish rather than a quantity of the flesh from one fish.