The Gemara in Nazir 5a learns that an unspecified nezirut is 30 days long from the pasuk "kadosh yihyeh"(Bamidbar 6,5) with יהיה- yihyeh having a gematria (Numerical value) of 30. Can anyone think of other places where halachot are learned from gematria? I'm looking for rishonim and earlier.
One of the first Tosafot in Gittin 2a (מתני' המביא גט) brings that the reason the Get has 12 lines is because the gematriya of Get is 12.
ומה שנוהגים לכתוב י"ב שורות בגט אומר ר"ת משום דגט גימטריא י"ב
That which we're accustomed to write 12 lines in a Get- Rabbeinu Tam says because "Get" has a gematriya of 12
...it says, (Shemot 35:1-2) And Moshe gathered together the entire congregation of the Children of Israel and he said to them: 'Eileh HaDevarim' (these are the things--plural) that HaShem Commanded to do them. Six days you shall do “Melacha” (creative physical activity--singular), and on the seventh day, it will be to you holy, a Shabbat of Shabbats for HaShem; anyone who performs during its course (the seventh day) “Melacha”, will die.
"Devarim"; "HaDevarim"; "Eileh HaDevarim" (these are three individual superfluities of language, each evoking a hermeneutic interpretation).
RaShI "Devarim" implies (due to its plural form at least) 2; "HaDevarim" implies (due to its being an “article” indicating specificity) 1; "Eileh" has a numerical value of ("Aleph" = 1; "Lamed" = 30; "Heh" = 5) 36. Altogether, 2 + 1 + 36 = 39.
These (the antecedents of “Eileh HaDevarim”, which we assume Moshe was informing the Jewish people about concerning the manner by which they were to observe Shabbat) are the 39 "Melachot" that were told to Moshe at Sinai.
תָּבוֹא בְכֶלַח אֱלֵי קָבֶר כַּעֲלוֹת גָּדִישׁ בְּעִתּוֹ
in which the bold word has the numerical value of 60, yielding the interpretation
You will come to the grave at 60, like a stack that goes in its proper time
I am not sure if this satisfies the criterion "halacha" in the question, but based on the context of the g'mara (regarding specific ages of death being consequences of sins) I think an argument could be made.
In the Yerushalmi (Shekalim 1:3), Rav Yochanan ben Zakkai's position that the tribe of Levi was obligated to give the annual half-Shekel Temple tax is derived from the verse (Exodus 30:13) זה יתנו where זה is 12 in Gematria, implying all 12 tribes need to give the tax. Rambam (Shekalim 1:7) rules like this opinion.
There are lots of examples of this in Sefer Kol-Bo (c. 14th century). One such example, brought in §122, concerns the halakha that a convert will only be accepted if s/he agrees to observe the entire Torah. This is learnt out from Psalm 146:7-9, as follows:
ה' מתיר אסורים, ה' פוקח עורים, ה' זוקף כפופים, ה' אוהב צדיקים, ה' שומר את גרים: ראשי התיבות הללו לבד מהשמות עולין תרי"ג. מכאן אמרו גר הבא להתגייר על מנת לקבל כל המצוות חוץ מאחת, אין מקבלין אותו, דלא נשלם מנין תרי"ג. ולכך כתוב את גרים, להשלים המנין.
"The Lord releases captives, the Lord opens the eyes of the blind, the Lord straightens the bent, the Lord loves the righteous, the Lord guards converts (שומר את גרים)": the first letters, excluding the divine names, produce [by gematria] 613. From here it is said that one who comes to convert on condition that he accepts all of the mitzvot except for one, we do not accept him, for that doesn't equal the number 613. It is for this reason that it is written, את גרים (et gerim; with the DDOM), in order to complete the number.
(In the other four examples, there is no DDOM [definite direct object marker = את] between the verb and the noun. Were the word את to be missing from the fifth phrase as well, the gematria would equal 612. The inclusion of that extra aleph raises it to 613.)
The Talmud Yerushalmi Sotah Halacha 5,1 derives that the man who cohabited with the Sotah also gets punished when the woman drinks the "cursed" waters because of the gematria:
כשם שהמים בודקין אותה כך בודקין אותו. המאררים אמר רבי תנחומא מנין המאררים נגד רמ"ח אברים שיש בה ונגד רמ"ח אברים שיש בו
Just like the Sotah waters check the woman to punish her for her adutery so too the waters check the man: Said Rabbi Tanchuma the gematria number of the word "cursed" (waters) "המאררים" is 496 corresponding to his body with 248 limbs and her body 248 limbs 248+248 = 496
According to Reish Lakish when put into Cheirem by a Chacham, a person's whole Body which has 248 limbs is put in חרם-excomunication gematria 248. Once the Chacham releases him, his limbs must be completely released from the Cheirem and revert back to normal as the Chacham should invoke Hashem's mercy after the anger, and רחם is also Gematria 248 so even though all his limbs were banned, so too they must all be released.
Moed Kotton 17a:
אמר ריש לקיש כשם שנכנסת במאתים וארבעים ושמונה איברים כך כשהיא יוצאה יוצאה ממאתים וארבעים ושמונה איברים כשהיא נכנסת דכתיב (יהושע ו, יז) והיתה העיר חרם חרם בגימטריא מאתים וארבעים ושמונה הוו כשהיא יוצאה דכתיב (חבקוק ג, ב) ברוגז רחם תזכור רחם בגימטריא הכי
There is a Machlokes between Beis Hillel and Beis Shammai Menachos 41b how many strings there should be on the Tzitzis: Beis Hillel say 3 which each have 2 ends which is 6 strings hanging out altogether, and Beis Shammai say 4 which each have 2 ends which is 8 strings hanging out altogether.
See Rashi Bamidbar 15,38 who brings a proof from the Gematria of "tzitzis" that the Halacha following Beis Shammai like Rav Papa paskens in the Gemara there, that 8 strings (and 5 knots) should be on each corner:
ועשו להם ציצת...וזכרתם את כל מצות ה'" - שמנין גימטריא של ציצית שש מאות ושמונה חוטים וחמשה קשרים הרי תרי"ג.
"We remember all the 613 Mitzvah of Hashem when wearing Tzitzis as ציצית is Gematria 600, add the 8 strings and 5 knots this makes 613. (If there were only 6 strings the Gematria would only be 611 which does not account all the Mitzvos)