סימן כה סעיף ח
כְּשֶׁיֵּצֵא מִבֵּית הַכְּנֶסֶת אָסוּר לָרוּץ אוֹ לִפְסֹעַ פְּסִיעָה גַּסָּה, לְפִי שֶׁמַּרְאֶה עַצְמוֹ שֶׁעִכּוּב בֵּית הַכְּנֶסֶת דּוֹמֶה עָלָיו לְמַשָּׂא. בַּמֶּה דְּבָרִים אֲמוּרִים כְּשֶׁהוֹלֵךְ לַעֲסָקָיו. אֲבָל אִם הוֹלֵךְ מִבֵּית הַכְּנֶסֶת לְבֵית הַמִּדְרָשׁ מִצְוָה לָרוּץ. (סִימָן צ').
When leaving the synagogue, it is forbidden to run or walk with long strides, because this would make it appear as if your stay in the synagogue was like a burden to you. This only applies when you leave to go to work,5If you leave with the intention to return to the synagogue it is preferable that you do rush and come back so much the sooner. (Mishnah Berurah 90:43) but if you leave the synagogue to go to a Beis Midrash (house of study)6In order to study Torah (Mishnah Berurah 90:43) then it is considered a mitzvah if you rush.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)