OK. The algae on the glass looks green in the photo, so this is common algae. The algae choking the plants in the second photo is a problm algae as I call all of these, whatever it may be. Which doesn't really matter, because there is one cause for problem algae and one way to resolve it. And that is the balance between light and nutrients.
When you have live plants, you need to find the balance involving light intensity, light duration, and nutrient availability. The light has to be intense enough to drive photosynthesis, and each species of plant has a somewhat different intensity level requirement. The light must also be the correct spectrum; red and blue drive photosynthesis, of which red is the more important, and adding green to this mix improves the plants' response. We can deal with spectrum fairly easily...either light with 5000K to 7000K (K being Kelvin, the colour temperature of light) or a high CRI (colour rendering index). Most of us select light around 6500K. The duration this light is on (assuming the intensity and spectrum are within range for the plants) can be tweaked, but one thing to keep inmind is that duration does not and cannot make up for weak intensity. If the light intensity is adequate, and the spectrum too, then "problem" algae may be thwarted by reducing the photoperiod. But nutrients also have to be considered.
Plants can only photosynthesize if the required nutrients are available, plus obviously the light issue. They will photosynthesize "full out" until something is no longer sufficient, then photosynthesis will slow and that is when algae takes advantage.
I have had problem algae caused by too much light, too little light, too much fertilizer, and too little fertilizer. Remember that nutrients occur from the fish being fed, from water changes, and from specific plant additives. The latter must always be balanced in proportion to each other as well, since too much of some nutrients can cause algae to increase.