The exact period of notice is stated in your tenancy agreement. If nothing is stated there, the statutory periods of notice apply. However, the notice periods for flats in Switzerland are at least three months and can usually always be terminated at the end of a month (except December).
Example: Today is 14 May. You have found a new flat for 1 September. If the letter of termination is received by the administration by 31 May, you can terminate your tenancy with three months' notice as of 31 August.