Positive commandment · Mitzvat Aseh #22 of 613
To keep watch over this house continuously
לִשְׁמֹר בַּיִת זֶה תָּמִיד
The verse · Bamidbar 18:2
וְגַם אֶת־אַחֶיךָ מַטֵּה לֵוִי שֵׁבֶט אָבִיךָ הַקְרֵב אִתָּךְ וְיִלָּווּ עָלֶיךָ וִישָׁרְתוּךָ וְאַתָּה וּבָנֶיךָ אִתָּךְ לִפְנֵי אֹהֶל הָעֵדֻת
“And thy brethren also of the tribe of Levi, the tribe of thy father, bring thou near with thee, that they may be joined to thee, and minister to thee: but thou and thy sons with thee shall minister before the tent of the Testimony.”
The Rambam’s words
To keep watch over this house continuously, as [Numbers 18:2,4] states: "And you and- your descendants before the Tent of Testimony.... [And they shall keep the watch....]"
לִשְׁמֹר בַּיִת זֶה תָּמִיד, שֶׁנֶּאֱמָר: "וְאַתָּה וּבָנֶיךָ אִתָּךְ לִפְנֵי אֹהֶל הָעֵדֻת" (במדבר יח, ב).
Who & when
“And it is practiced by priests and Levites [that are] males at the time of the [Temple].”
Where in the Mishneh Torah
Hilchot The Chosen Temple הלכות בית הבחירה