From a tax perspective, voluntary purchases are most interesting in the years in which you earn the most. These are the years in which you pay the most taxes, not only in absolute figures but also as a percentage.

However, you should not pay in so much in one year that you do not have to pay any taxes at all. As a rule, it is better to smooth out taxable income over several years by breaking income peaks with high marginal tax rates.