If there is a need to ask a question, then the student of knowledge should ask it well (clearly, concisely and with good etiquette). But if there is no need, then he shouldn’t ask, because it is not befitting for a person to ask questions, except if he had a need, or thought that someone else needed the question.
For example, someone could be in a lesson and understood the content, however there may be some difficult issues/concepts which need further clarification for the rest of the students, so he asks for the benefit of others, and the questioner in this situation is like the teacher, because the Prophet (peace and blessings upon him) when Jibreel (alayhis salaam) came to him and asked him about Eemaan, Ihsaan and Islaam, and the Hour and it’s signs; he (peace and blessings upon him) said, “This is Jibreel who has come to teach you your religion.”
In conclusion, if a person asks a question for his benefit or for someone else’s benefit then this is noble and good. However if he asks just so the people say the likes of, “Maa Shaa Allah, so and so has zeal towards knowledge and many questions”, then this is wrong. And the opposite to this, where someone does not ask out of shyness, then the first individual is excessive, and the second is neglectful and the best of affairs is the middle course.
Sharh Kitab al-Ilm pg 241-242 Slightly Paraphrased