Quick search by citation:

5 U.S. Code § 7324 - Political activities on duty; prohibition

(a) An employee may not engage in political activity—
while the employee is on duty;
in any room or building occupied in the discharge of official duties by an individual employed or holding office in the Government of the United States or any agency or instrumentality thereof;
while wearing a uniform or official insignia identifying the office or position of the employee; or
using any vehicle owned or leased by the Government of the United States or any agency or instrumentality thereof.
An employee described in paragraph (2) of this subsection may engage in political activity otherwise prohibited by subsection (a) if the costs associated with that political activity are not paid for by money derived from the Treasury of the United States.
(2) Paragraph (1) applies to an employee
the duties and responsibilities of whose position continue outside normal duty hours and while away from the normal duty post; and
(B) who is—
an employee paid from an appropriation for the Executive Office of the President; or
an employee appointed by the President, by and with the advice and consent of the Senate, whose position is located within the United States, who determines policies to be pursued by the United States in relations with foreign powers or in the nationwide administration of Federal laws.
Editorial Notes
Prior Provisions

A prior section 7324, Pub. L. 89–554, Sept. 6, 1966, 80 Stat. 525; Pub. L. 93–268, § 4(a), Apr. 17, 1974, 88 Stat. 87, prohibited Executive agency employees and employees of the District of Columbia from influencing elections or taking part in political campaigns, prior to the general revision of this subchapter by Pub. L. 103–94.