You can pay into the pillar 3a until you reach the regular AHV retirement age. Beyond that, payments can only be made if you can prove that you are still employed. At the latest, however, at the age of 69 or 70 (women/men), the pillar 3a must be dissolved and the credit balance withdrawn.
Up to what age can you pay into the pillar 3a?
3a Retirement Savings Foundation