In total, the Secret Service spends more than $750 million of its $1.8 billion budget on protective operations. That includes not only protection of the White House compound, Mr. Trump, his family and other current and former top government officials, but also security for visiting foreign dignitaries and the United Nations General Assembly each year.

The agency declined to comment on the legislation.

Aside from the Secret Service, the biggest beneficiaries under the agreement would be New York City and Palm Beach County, where Mr. Trump and his family have spent the bulk of their time away from Washington since Election Day. Bedminster, N.J., where Mr. Trump owns another golf club and is expected to spend time in the coming weeks and months, would also be eligible to apply for the funds.

Congress had previously approved $7 million to reimburse local law enforcement for the costs of protecting Mr. Trump between Election Day and the inauguration. The new agreement will provide that money, plus $20 million for the same period and $41 million for the period from Jan. 20 until the end of the fiscal year.

“Although the federal government does not otherwise reimburse costs of state or local law enforcement for activities in support of the United States Secret Service protection mission,” the legislation reads, “these funds are being provided in recognition of the extraordinary costs borne by a small number of jurisdictions in which a residence of the president is located.”

More than 100 days into Mr. Trump’s presidency, those jurisdictions said they have yet to see any federal money and are still awaiting instructions on how to apply for the bulk of the reimbursement.

New York City has shouldered the heaviest cost since Mr. Trump was elected. James P. O’Neill, the police commissioner, wrote in a letter in February to the state’s congressional delegation that the Police Department had spent $300,000 a day protecting Trump Tower between Election Day and Inauguration Day and $127,000 to $145,000 a day since then, on top of other costs.