To understand the grammar of the Latin question, you may first need to understand the grammar of the English question so you can leave it behind. The noun "size" has peculiar grammar here, roughly only about 100 years old, briefly explained in an English Language Learners answer here. Non-native speakers are often baffled by the lack of a preposition before the noun ("What size of cake do you need?") or the choice of a noun rather than an adjective ("How big a cake do you need?"), both of which are more consistent with the rest of English grammar and parallel Romance-language grammar.
The noun "color" has the same peculiarity in English. I once baffled my Italian teacher trying to render "What color is…" in Italian. The correct Italian is Di che colore è…—the equivalent of the genitive in Latin.
Another clue is to consider the equivalent indicative sentence, or a full answer in the first person:
Libo magno egeo.
Capilli mei sunt fusci.
To make these into questions, you need some sort of interrogative word in place of the bold adjectives and maybe move it to an emphatic place in the sentence. My command of Latin is not strong enough for me to be sure of the most idiomatic phrasings, but I would think this is most natural, using quantum as an interrogative adverb:
Quantum magno libo eges? ("How big a cake do you need?")
or even using quanto as an interrogative adjective:
Quanto libo eges? ("What size cake do you need?", but maybe "How much cake do you need?")
There is no abstract adjective corresponding to fusci, so to make a question, you'll need to switch to the noun color, and that will require the genitive case, because it still needs to modify capilli:
Cuius coloris sunt capilli tui?
So that's the answer to your question: to get a noun, that names what you are asking for, to modify another noun. (Strictly speaking, cuius is an interrogative adjective here rather than a pronoun.)
The same works for converting magno to a noun, of course:
Cuius magnitudinis libo eges?