The standard refrigerator temperature most official websites assume are around 4C. Yes, there are different temperature zones in home refrigerators, but that’s included in the general recommendation of 3-4 days for “prepared foods” category - which wet coffee grounds would fall into.
Freezer storage below-18 C is “unlimited” from a microbiological perspective - the activity of mold and bacteria is near zero. But over time, the quality of frozen food will suffer. Interestingly, it’s often the fats that still will go rancid, especially if the item isn’t wrapped tightly and oxygen can reach the product. Improper packaging and temperature fluctuations can also create freezer burn. As the oils in coffee are an important contributor to flavor, I wouldn’t exceed three months of freezer time, but that’s purely for quality reasons, not due to food safety concerns.
Our sister site Seasoned Advice has a generic Q/A on safe storage times and a lot of additional information.