Switzerland has several types of residence permits depending on your nationality and employment situation. Your commune will begin the process when you register.
EU/EFTA citizens
EU and EFTA citizens can apply for an L permit (short-term, up to 1 year) or a B permit (1 year, renewable). After 5 years of continuous residence, you can apply for a C permit (permanent settlement).
Non-EU/EFTA citizens
Non-EU citizens need a work permit sponsored by their Swiss employer. The employer applies to the cantonal migration authority before you arrive. The most common permit is a B permit (1 year, renewable).
C permit (permanent)
After 5–10 years (depending on nationality), you may be eligible for a C permit. This gives you nearly the same rights as a Swiss citizen, including the right to change jobs freely and access to some social services.