Hi Alsu!
''Mucho'' can work as an adverb ''Él come mucho'', modifying the verb ''comer'' in this case. Because it is an adverb it can't vary (it hasn't masculine or femenine, or plural option)
But ''mucho'' it can work as well as an adjective, like in the case that you expose. As an adjective, modifying the names ''hambre'' and ''sueño'' it has to be masculine/ femenine/singular/plural according to the name that modifies. ''El sueño'' is masculine, but ''El hambre'' is femenine. Why? you should ask. If it's femenine why we say ''el hambre''? Because we find here an exception with the word ''hambre''. As other femenine names starting with tonic ''a'', like ''alma'', 'águila'', ''hacha'', etc. the accent goes to the first syllab, that's why we say ''a'' tónica. And for these names, when they are femenines we change the article for a cuestion of sound and we say ''el alma''/ ''un alma'', ''ningún/algún alma, ''el águila''/''un águila'', ningún, algún águila, But for other determinants we don't apply the exception. So we say in this case ''el hambre'' (applying the exception) but ''mucha hambre'' (not applying it here with the adjective mucho/a, that has to be femenine if the name is femenine, like the case of ''hambre'').
I hope my explanation is not too much and it can be useful for you.
Best regards
Emilio Ramón
Los articulos , el, la, los, las, te determinan en casi todos los casos.
La, las para muchas.
el, los para muchos.
Excepcion EL Hacha. Lo correcto es muchas hachas. Pero por regla no decimos la hacha para no juntar dos vocales A. Y que suene lacha. Ya que la H no se pronuncia en español.