WASHINGTON—Congressional and White House negotiators reached a deal to increase federal spending and raise the government’s borrowing limit, securing a bipartisan compromise to avoid a looming fiscal crisis and pushing the next budget debate past the 2020 election.

The deal for more than $2.7 trillion in spending over two years, which must still pass both chambers of Congress and needs President Trump’s signature, would suspend the debt ceiling until the end of July 2021. It also raises spending by nearly $50 billion next...