There are two components that determine the cost of applying for a patent: The filing fees to the governmental patent institution, here it is typically the US Patent and Trademark Office (USPTO), and the fees to the professionals preparing and/or assisting with the patent prosecution, that is patent practitioners (lawyers or agents), searchers and drafters.
The practitioner fees vary widely; lawyers mostly charge in the range of $300 to $700 per hour and agents between $120 to $250 per hour. The fees of a moderatly complex patent application by a law firm will be in the range of $8,000 to $13,000. The expense grows rapidly if appeals become necessary. The same application prosecuted by an agent will be in the range of $4,000 to $7,000.
These expenses can be lowered by inventors doing some of the work themselves, especially searches and drawings. Another approach I like to suggest is to combine the do-it-yourself approach with letting an agent prepare a complete application and letting a patent law firm with a strong track record in the field to which the invention belongs to review, edit and prosecute the application.
The USPTO fees are listed on the USPTO website at http://www.uspto.gov/web/offices/ac/qs/ope/fee010114.htm. The fees are listed in three columns: standard fee, fee for a small (business) entity and the micro entity fee. The micro entity fee will apply to most individual non-business inventors.