The Justice Department often foregoes announcing new developments in a case or taking overt investigative steps within 60 days of an election, so as to avoid influencing it. But it's not a law.
The department, after examining the impact of various actions by FBI Director James Comey and others during 2016, reported that “the 60-day rule is not written or described in any department policy or regulation." Its 2018 report found "the most explicit policy" concerned crimes that could affect the integrity of the election itself, such as voter fraud. "There is generalized, unwritten guidance that prosecutors do not indict political candidates or use overt investigative methods in the weeks before an election."