Over the economic cycle, a government should borrow only to invest and not to finance current spending. This rule is certainly a prudent approach to fiscal policy, provided that governments are honest in describing spending as investment, that they invest in appropriate things and do so efficiently, and that they are careful to avoid crowding out superior private investment. But there are other fiscal policy options that may make as much sense. See, for example, balanced budget.
The golden rule stipulates that over the economic cycle, the government should borrow only to invest and not to fund current spending. More specifically, it requires the current budget to be in balance or surplus on average over the economic cycle.