"And it came to pass, as she prayed long before the LORD" (1 Samuel 1:12). Rabbi Chiyya in the name of Rabbi Yochanan, and Rabbi Shimon ben Chalafta in the name of Rabbi Meir: "And it came to pass, as she prayed long" — from here, whoever prays at length is answered. The teaching of Rabbi Levi is reversed. There Rabbi Abba the son of Rav Pappi and Rabbi Yehoshua of Sikhnin said in the name of Rabbi Levi: "In all toil there is profit, but the talk of the lips tends only to want" (Proverbs 14:23). Hannah, because she prayed long, shortened the days of Samuel, as she said, "and he shall dwell there forever" (1 Samuel 1:22) — and the "world" of the Levites is only fifty years, as it is written, "and from the age of fifty years he shall return from the host of the service" (Numbers 8:25). But behold, they are fifty-two! Rabbi Yose bar Rabbi Avin said: The two are those by which she weaned him.
Hannah's Long Prayer and the Shortened Years of Samuel
Midrash Shmuel 2:9
והיה כי הרבתה להתפלל (אל) [לפני] ה' וגו'. רבי חייא בשם רבי יוחנן ורבי שמעון בן חלפתא בשם רבי מאיר והיה כי הרבתה, מכאן כל המרבה בתפלה נענה, מחלפה שיטתיה דרבי לוי, תמן אמר רבי אבא בריה דרב פפי ורבי יהושע דסכנין בשם רבי לוי בכל עצב יהיה מותר ודבר שפתים אך למחסור (משלי י"ד כ"ג), חנה על ידי שרבתה בתפלה קצרה ימיו של שמואל, שאמרה וישב שם עד עולם, אין עולמן של לוים אלא חמשים שנה, הדא הוא דכתיב ומבן חמשים שנה ישוב מצבא העבודה וגו' (במדבר ח' כ"ה), והא אינון חמשין ותרתין, אמר רבי יוסי בר רבי אבין שתים שגמלתו.