The James Webb Space Telescope (JWST) is expected to cost NASA $9.7 billion over 24 years. Of that amount, $8.8 billion was spent on spacecraft development between 2003 and 2021; $861 million is planned to support five years of operations. Adjusted for inflation to 2020 dollars, the lifetime cost to NASA will be approximately $10.8 billion.
That is only NASA’s portion. The European Space Agency provided the Ariane 5 launch vehicle and two of the four science instruments for an estimated cost of €700 million. The Canadian Space Agency contributed sensors and scientific instrumentation, which cost approximately CA$200 million.
This places the James Webb Space Telescope among the most expensive scientific platforms in history, comparable only to the James Webb Space Telescope and the Large Hadron Collider at CERN.
NASA’s contributions to the telescope were not paid out all at once, but spread out over the course of two decades. Annual expenditures vary depending on the particular needs of the project and how many highly-trained technicians, engineers, and scientists are assigned to the program at any given time. This type of cost phasing makes it easier for NASA to shoulder the expenses of a large project year-to-year. Despite its delays and cost overruns, the project never required more than 3% of NASA's annual budget.
NASA's annual obligations for the James Webb Space Telescope (JWST) project, not adjusted for inflation. The spacecraft will begin its operational phase in FY 2022. Amounts after the current year are official projections. Source: NASA Budget Requests FYs 2005 - 2022.
Source:
https://www.planetary.org/articles/cost-of-the-jwst