Spousal Support for a "long-term" marriage (which pursuant to Family Code Section 4336 would generally be a marriage of 10 year of more) is ordinarily awarded until the recipient's death or remarriage. Spousal Support for marriages under 10 years of duration is ordinarily awarded for 1/2 of the term of the marriage. Other factors may influence the duration of Spousal Support, so you should consult with a Family Law Attorney, preferably a Certified Family Law Specialist, to discuss the particulars of your situation.
Nothing is forever. As Mr. Conviser has stated, there is a difference in the treatment of support in a "long" term marriage (one over 10 years duration) and a marriage less than 10 years. There are many, many factors a court will consider when determining a spousal support request. Those factors are found in Family Code Section 4320.
Now, after 20 years of marriage, if your former spouse does not remarry and does not move in with a male friend, you could be paying support for a long time. If the judgment has not yet been entered, you may want to ask the court to give a "Gavron" warning. What that means is the Court will admonish your former spouse that it is the goal of the State that all parties become self supporting. Basically, it's a warning that she cannot simply rely on you to pay her support and not try to make a living on her own.
You may want to consult with a family law lawyer in your area for further explanation or if you have more questions. Good luck!
NOTE: This answer is made available by the lawyer for educational purposes only. By using or participating in this site you understand that there is no attorney client relationship or privilege between you and the attorney responding. Do not use this or any answer by the responding attorney as a substitute for competent legal advice from a licensed professional attorney practicing in the area in which your question pertains with whom you have an attorney client relationship. The law frequently changes and will be different from state to state. The response provided above is general in nature, and is based solely on the facts provided in the question. Fact not included in the question may have a bearing on the response.
In addition to the other answers I want to add that there is nothing preventing you from negotiating an unmodifiable termination date if you and your spouse carefully bargain for it and the court is satisfied that the agreement is not unconscionable for either party or risky for the public fiscus.
Disclaimer: Please note that this answer does not constitute legal advice, and should not be relied on, since each state has different laws, each situation is fact specific, and it is impossible to evaluate a legal problem without a comprehensive consultation and review of all the facts and documents at issue. This answer does not create an attorney-client relationship.
A weekly guide with tips and legal advice for each stage of the process.