On planets near M dwarfs, photosynthesis (PS) will occur with an effectiveness which depends on the supply of visible photons with wavelengths between 400 and 700 nm. In this paper, we quantify the effectiveness of PS in two contexts which are relevant for M dwarfs. First, using photons from an M dwarf in its quiescent non-flaring state, we find that PS on an M dwarf planet in the HZ of its parent star is less effective than on Earth by a factor of 10 for a flare star with mid-M spectral type. For a flare star with late-M spectral type, PS effectiveness is smaller than on Earth by a factor of 100 or more. Second, using photons which are incident on the HZ planet during flares, we find that PS effectiveness can increase by factors of 5-20 above the quiescent values. In the case of a flare star with mid-M spectral type, we find that the PS effectiveness during a flare can increase up to as much as 50-60 percent of the values on Earth. However, for a late-M flare star, even during flares, the PS effectiveness remains almost one order of magnitude smaller than on Earth. We suggest that for biological processes on M dwarf planets, the stellar activity cycle may replace the orbital period as the year.