Actually this is a question that cannot be answered easily!
A patent is a territorial right! This means you need to get a patent granted in every country you want protection in! So the answer to the question about the costs of a patent is strongly dependent on where you need protection! If protection in your main market is sufficient then quite a good estimation can be made!
Let's suggest you only need a national patent protection (Germany, USA....). The costs for the first five years are around 2000 - 6000 €/$. This is strongly dependent on the complexity of your invention and the costs of the patent attorney.
You can maintain a patent for up to 20 years in most countries. Often the fees go up exponentially. This means you have to calculate additional costs over the lifetime. A patent can become quite expensive.
Many states offer support programs! These normally make it easy, especially for small companies, to get financial support.
So make sure you look for support programs in your countries! There you find lots of help and often they advise you if a patent application makes sense for your invention!
For start-ups patents are often essential because they are the basis for contracts on technology! If you have any questions feel free to ask! Find the full section and further information in my Video - Courses!