The short answer
This sentence has never been located in Edmund Burke's writings, letters, or speeches. The Yale Book of Quotations records it as frequently attributed to Burke but never traced in his work, noting an attribution in the Washington Post in January 1950. It is one of the most confidently cited quotations in political English and one of the least verified.
The reference-book controversy
The attribution was partly manufactured by a mistake in a trusted source. Bartlett's Familiar Quotations printed it in its 14th edition (1968), citing a letter Burke wrote to William Smith in 1795 — except that the letter contains no such sentence. An editor of the following edition suggested it must be a loose paraphrase of a different passage entirely. When a standard reference work makes an error of this kind, the error propagates faster than any correction.
What Burke did write
In Thoughts on the Cause of the Present Discontents, published on 23 April 1770, Burke wrote that when bad men combine, the good must associate, or they will fall one by one, an unpitied sacrifice in a contemptible struggle. This is the passage usually offered as the seed of the famous version — and it is a better sentence.
Why the difference matters
The Yale scholar David Bromwich has argued the popular version is not merely inauthentic but weaker: evil is not a disembodied force that triumphs on its own, and inaction by good people is not the only thing required for it to prevail. Burke names actual agents who combine, and prescribes a specific remedy — association, not mere good intentions. The slogan replaces a mechanism with a mood.
There is a genuine version of this idea
If you want the sentiment with a verifiable source, John Stuart Mill supplies one. In an 1867 address on education he wrote that bad men need nothing more to achieve their ends than that good men should look on and do nothing. That is very close to the popular line, it is real, and almost nobody quotes it.
What this means for your English
Read Burke's sentence and the slogan aloud, one after the other. You will feel the difference between formal, clause-heavy written English and modern spoken English — subordination and qualification on one side, a single clean claim on the other. Recognising which register a situation calls for is one of the clearest markers of an advanced speaker.