On a new package, keep it on for at least a month so they can build out their brood nest, usually two deeps or the equivalent. On an established colony, whenever they have a couple frames of capped honey stored. Otherwise it's when they stop taking it, as they prefer nectar. You may have to start feeding again when their honey stores become low. Usually due to what is called a dearth where there is no natural nectar available. Or to build up for the winter season. It's all subjective to your particular climate and locale. Welcome to the world of beekeeping