Jefferson never said this. It is a common quote misattributed to Jefferson as is the more common “When injustice becomes law, resistance becomes duty.” The latter was used by both ML King, Jr. and Nelson Mandela.

from the Declaration of Independence…Jefferson states, “…when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government…”
The misquote has been in circulation since 2006

The Marin Luther KIng Jr. quote originates from the American Confederacy (C.S.A) during the war of northern aggression (the Civil War). It was originally phrased as “WHEN TYRANNY BECOMES LAW, REBELLION BECOMES DUTY”.