Learners should desire staying with the teacher or being very close to him. This is called mulaazamah.
You can stay with him under the same roof - like Anas, Ibn Umar and Ibn Abbaas would sometime do to the Messenger of Allaah (sallaLaaahu alayhi wasallam), or being within his reach - like Abu Hurairah and other members of the Suffah would do. May Allaah be pleased with all.
Those who do mulaazamah of a certain Shaykh are prone to gain more from those who only pick knowledge rarely from the same Shaykh.
History is replete with the good result from mulaazamah of certain students with their teacher.
Al-Haafidh Ibn Hajar did Mulaazamah of Al-Haafidh al-Iraaqee that it was thought he would follow the latter to the grave when he died. May Allaah show mercy to both.
If Allaah blesses one with a company of a pious and knowledgeable teacher, one will enjoy every bit of this life. Imagine staying with a scholar of Qur'aan where you can have as many as possible khatmah of different Qiraa'aat with him. The same thing goes with a scholar of hadeeth.
One of the most fundamental ways of learning is being under the feet of a teacher. Generally those who stay long under a teacher are believed to do better than those who are hasty to get off.
Everything is however by tawfeeq - Allaah's grace, but doing what is better is better.
If Allaah grants you the opportunity of getting a teacher you can spend a great part of your life with, please stay with him. Don't be hasty. But be sure the teacher has what you want; the knowledge is vast, and the taqwah is there.
When you think you are done with him, move on to another teacher.
The Messenger of Allaah (sallaLaaahu alayhi wasallam) said:
إنما العلم بالتعلم...
Knowledge is by being sought...(Saheeh)
Wahb bn Jareer said he sat with Hasan Al-Basree for seven years and that he never stayed away from him. Allaah's mercy on both.
So also was Qataadah bn Di'aamah as-Saddusee - rahimahullaah; he stayed with Anas bn Maalik - radiyallaahu an'hu - for a long time such that he would be present in the evening lesson which was the same thing presented in the morning lesson. He stood in for Anas bn Maalik in an evening lesson one day and performed brilliantly.
So stay with your teacher.
May Allaah grant us success.