When an academic researcher decides to file for a patent, where does the budget to pay for the patent-related costs typically come from? When an academic researcher decides to file for a patent, where does the budget to pay for the patent-related costs typically come from? From the academic researcher's budget? From the University's intellectual property/legal budget? From somewhere else?
In my experience, in the United States, patenting is typically provided as a service by the university, budgeted to its intellectual property office (or equivalent).  

Since the university typically owns the rights to all work done by its employees, it is more or less compulsory for them to use its services if they wish to patent.  Moreover, many of these organizations will actively solicit interactions with faculty and offer them assistance in patenting as otherwise many faculty will not bother to patent things the university might be interested in licensing.

For most universities, this office is probably able to effectively pay for itself via licensing fees, though there might be any number of complexities in how the actual accounting might be done.