It's a somewhat unusual use of these expressions and it requires the full context to be read and understood. The article you link to is Bill Gates' own personal philosophy about optimism and pessimism, which are normally considered opposites, but Gates has a theory that they can both be useful.
'The long-run' and 'the short run' both refer to indeterminate periods of time over which a scenario can play out. For example, if some action needs a long period of time to yield any benefits you might say it has little effect in the short run, but it is worthwhile in the long run. Comparable expressions are "short-term" and "long-term".
Gates appears to say that, when it comes to finances, if you are pessimistic in the short term (ie you believe that the financial situation in the near future is poor) then you will be inclined to save money. But, as a result of saving money now, you will have money to invest in long-term projects which may yield rewards later on, but do so you would need to also be optimistic about the further future.