How do they calculate the amount to pay for AHV? Do they take your gross income from other country and then you pay the full employer and employee contribution? This could end up being quite expensive...
For the first pillar, contact the AHV cantonal office. They will tell you if you can or if you need to top it up in any way, how many years of contribution you have and also predicted pension if you wish.
For the second pillar, contact your job's pension fund.
Well, I've heard about the "buying back" thing within my first 5 years here, but my inquiries ended with understanding that if I was working in EU before moving here I didn't have any AHV gaps to buy in. I don't know, maybe I misunderstood it due to language barrier, or maybe it was simply not possible due to EU laws.
OP, the term "gap" has many meanings. One might take a break without voluntary payment to AHV and zero contribution within a year makes you a gap in AHV years, where you need 40 years to get full 1st pillar pension. Now with 2nd pillar, the gap mean that the funds you have accumulated in your 2nd pillar will not provide you with retirement benefit giving you a lifestyle level matching your current one (living off your current salary). Of course people always start careers from lower salaries, so everyone has a gap at some point in their 2nd pillar as the previous contributions were much lower. Anyway, the minimum contribution (deduction from your salary) depends on your age. There are employers who pay more than the minimum, but most stick with the minimum I guess. In the end, the closer to the retirement the higher the % of your salary goes to 2nd pillar, plus usually your salary should be at the highest.
There's no time limit to top-up into your 2nd pillar, there's only amount limit. The more your earn the bigger pot you are allowed to have in your 2nd pillar, alas I don't really understand what's happening with 2nd pillar if someone riches the top of his career then decides to switch to some easy work paying peanuts. Most likely normal monthly deductions still have to be put into 2nd pillar but of course it won't be possible to top-up it as there would be much more money than a current salary would ever allow to build up.