Allah has mentioned in the Quran Al-Karim about how he grants wisdom and gives knowledge. In Surah Al-Baqarah verse: 269, Allah the All Mighty says:
"He grants wisdom to whom He pleases, and he to whom wisdom is granted indeed receives a benefit overflowing". And, in one of those verses in Surah Toa-ha: 114, Allah has enjoined all of us including the Prophet Muhammad SAW to ask for knowledge from him.
"And say: My Rabb (Cherisher and Sustainer) increase me in knowledge.