As said above, algae comes from light and nutrients in the water.
The only way to get rid of nutrients are by diluting them with partial water changes.
This means, a regular regime of partial water changes (on going).
Some people do one 50% water change per week, some more, some less.
I usually figure 30-40% every other day to keep my nutrient level (nitrates) between 2 to 5 ppm. With that regime, I seldom had excess algae, except where suns rays would hit the glass.
My lights were on timers (with tanks that had plants, about 8 hours per day).