hi and welcome
you should leave the filter on all the time - a tank cycle is where the bacteria in the filter media, substrate, and water column changes the ammonia produced by the fish etc to nitrite, then that nitrite changes to nitrate. it can take a couple of weeks or longer for that to happen. just do regular water changes about 30% every 4 days or so and you should be fine.
hope that helps