Recently I have been flying an aircraft with the landing gear very dirt with mud due to the parking area of the airfield on grass and the meteo conditions in recent days. I wonder what are the threats to have the landing gear with mud on it especially with retractable landing gear system as I had that day. Just for info I was flying a PA28R-201.
The main issues would be mud interfering with the uplock/downlock mechanisms, the switches that control indication of the function of those mechanisms, the brakes, and wheel balance. Mud + freezing temperatures = worse. Gears won't lock down, or they lock down but you don't get an indication, or the wheels freeze and skid on landing and blow tires, or mud in the wheel rim makes the wheel vibrate all to hell on takeoff.
There is usually enough robustness in the design that it can tolerate some contamination (obviously, it has to have some ability to take on mud on takeoffs from dirt runways), so as with most things, it depends how much when you look at it. A little bit of mud spray here and there, not too big a deal. Mud caked on on the wheels, brake calipers, any of the mechanical bits in the wheel well, that could interfere with moving parts, it should be removed before flying by hosing it off.
The mechanic who maintains the airplane you are renting would be a good person to ask about how to judge when mud contamination is excessive.