The Federal Tax Credit will apply to the total cost of the system for as long as you have the tax liability. This is not a deduction, but a check the IRS will send you when you file your tax returns.
The Inflation Reduction Act recently increased the tax credit from 26% to a full 30% of your system cost. There is no better time than now to get your solar system installed!