The quarterstaff and its use—as described by 15th & 16th century sources—differs greatly from what we tend to see in movies, on TV, or in games.
You may have heard various reasons for the name “quarterstaff”, but the truth is that we don’t know.
The “short staff” of George Silver’s Paradoxes of Defence (1599) is 8–9 feet. (Contrasted against the 12–18-foot “long staff”.) This was not simply a scavenged branch (or a wizard’s walking stick) but a purpose made weapon, often with iron shod tips. Perhaps even sharped. It would, of course, be made of a hard wood like ash.
I haven’t found information about a period source for the diameter. Perhaps 1¼–1½ inches?
While the hands were presumably repositioned during use, the “default” grip would be to have one hand near the butt end and the hands about 1–1½ feet apart. Much like the use of other pole weapons.
To—as is my wont—apply this to role-playing games: A walking/wizard’s staff and a quarterstaff should be different things. A wizard’s staff used as a weapon ought to be treated as an improvised weapon. A quarterstaff should certainly not be free. For D&D, wizards should not get quarterstaff proficiency. (Indeed, oD&D and B/X do not allow magic-users to wield quarterstaves.)
If applied to my classic D&D melee weapons, perhaps a quarterstaff should become a large weapon?
On a related note: Did Gandalf use his staff as a weapon? (Spoiler: No.)