All documents, papers and records in the office of the board of elections for each district, relating to the conduct and result of any primary or election, shall be preserved for a period of at least two years, and shall be preserved for a greater period if the board has been notified in writing by the United States attorney, or by a judge of a court of record, to preserve such papers for a longer period of time, for the purposes of pending prosecution or litigation.