Negative commandment · Lo Ta’aseh #60 of 613
The prohibition against blessing [i.e., cursing] G-d's name
שאנו מוזהרין על ברכת השם
The verse · Shemot 22:27
אֱלֹהִים לֹא תְקַלֵּל וְנָשִׂיא בְעַמְּךָ לֹא תָאֹר
“Thou shalt not revile the judges, nor curse the ruler of thy people.”
The Rambam’s words
The prohibition against blessing [i.e., cursing] G-d's name, as [Exodus 22:27] states: "Do not curse G-d." [Leviticus 24:16] mentions the punishment: "One who curses the name of G-d shall surely die." This is a general principle: A negative commandment is involved whenever the Torah mentions the punishments of karet or execution - with the exception of circumcision and the Paschal sacrifice which are positive commandments punishable by karet.
שאנו מוזהרין על ברכת השם, שנאמר "אלוהים, לא תקלל" (שמות כב,כז), ונאמר בעונש "ונוקב שם ה' מות יומת" (ויקרא כד,טז). .וזה הכלל: .כל שענש עליו הכתוב כרת או מיתת בית דין, הרי זו מצות לא תעשה--חוץ ממילה ופסח, שהן בכרת והן מצוות עשה.
Who & when
“And this prohibition is practiced in every place and at all times.”
Where in the Mishneh Torah
Hilchot Foreign Worship and Customs of the Nations הלכות עבודה זרה וחוקות הגויים