I know we get a lot of requests here for translations of idioms and expressions, and many times they don't exist. (Something I often point out myself.) But I thought this might deserve some discussion anyway. First, this is a phrase I associate with programming. For instance you've got a really messy section of code, the logic is more complicated than it needs to be, and it's not at all clear by inspection how or why it works. Usually these are created by a series of "quick and dirty" fixes, small changes that sacrifice programming quality for the sake of repairing a problem as quickly as possible. So there's a temptation to rewrite the poorly written code to clean up the logic and make it easier to understand what the code is actually doing. But it's often a mistake to start on such a code improvement project because it's unlikely to actually improve performance and may, in fact, introduce problems that weren't there before. It's usually when the new problems appear that you realize should have followed the "if it ain't broke, don't fix it" advice. Obviously one should not take the advice in all situations though; it's not a good idea to wait until your brakes are scraping metal on metal before you get the pads replaced. Also, programming isn't the original context; apparently it was first popularized by Bert Lance, a former cabinet member in the Carter administration.
Wiktionary gives four translations of the phrase, but they're variations on the first one: "man soll nicht reparieren, was nicht kaputt ist". Translating this back into English: "one shouldn't repair what isn't broken". I'd argue that while this gets to the technical meaning, it doesn't really capture the original English version. For one thing, the English uses highly nonstandard and colloquial language, "ain't" instead of "isn't", "broke" instead of "broken", "fix" instead of "repair". I'm pretty sure Bert Lance spoke better English than that. Translating it into flawless Standard German doesn't really capture the "I might not know grammar, but I do know this, and so should you" feeling conveyed by the original expression. More importantly, the nonstandard language allows for a pithiness that may not be possible otherwise. It sounds like you're compressing a lifetime's experience into seven single syllable words.
A similar phrase in English is "leave well enough alone", and Wiktionary translates this as "das Bessere ist des Guten Feind". At first I thought this sounded like a good candidate but I gather from DWDS that the meaning is kind of the opposite, more like "good isn't good enough if there is something better". I think this is a word for word translation of "perfect is the enemy of good" which means something very different from the German. I interpret it as something like "Don't spend years trying to make something perfect when you can make something good in a few hours."
So there are several aphorisms in English which express the same general idea; perhaps "don't gild the lily" is another one. But I couldn't find something similar in German other than direct translations from the English.