The answer is relatively simple, if you realize that in fact to explore distance in an expanding universe it is useful often to use the redshift, z. It is an unambiguous way to get the distance. z is the redshift due to the expansion of the universe (considering us as the observer, the universe expanding away from us, and slightly adjusting for the peculiar velocity of the earth, or Galaxy, and our cluster/supercluster relative to the average flow of the universe, the so called Hubble flow).
See a description of distances in cosmology, and z, at
One of those distances described is basically what you are asking. You are asking how does a star's or galaxy's luminosity (the total energy per unit area per unit time from it photons) change in the expanding universe as its light moves away from it - it is like asking what does it's luminosity look like as function of distance from it. If there was no expansion it would decrease as 1/$d^2$, with d the distance. You can also use time in the equation because if no expansion, in a flat universe, d= ct, c the speed of light, and t the time since it was emitted.
But those equations change in an expanding universe. And one simple way of writing those are using the redshift z of where that light was emitted. If we use physical distance, D, (also called proper distance, and for us it is also the comoving distance), the apparent luminosity distance $D_l$ is related to it as
$D_l$ = (1+z)D
With z the redshift, which is 0 or higher.
That is the luminosity distance is bigger than the physical distance. Objects appear to be further than they are, because they are more faint. Those galaxies or stars appear fainter to us because their photons spread out more, traveled further, because the universe expanded under them.
An example is in the wiki article referenced above. See the figure, the lower one, also shown below. At a redshift z of about 1 the physical or comoving distance is about 10 Gly, 10 billion light years. But the distance we see, the luminosity distance, is about 20 billion light years.
With the equation above,
$D_l$ = (1+z)D = (1+1)D = 2 times 10 billion light years = 20 billion light years. Just like the graphic ((hard to get exact numbers in the graphic).
So it look fainter, we think it's twice as far, because it looses luminosity to the universe expansion.
It is a significant, and not a trivial effect, and astronomers adjust for it when measuring distances and luminosities, and other physical entities. So far, they have been consistently valid.
It should be noted that some of the numbers in some of the other answers are wrong. At a z of approximately 1.5 the speed of expansion is already the speed of light, c. That's at about a proper/physical/comoving distance of about 14 billion light years. At the particle horizon at a distance of about 46-47 billion light years the universe is expanding at roughly 3c. We can't see anything further, that is the horizon of our observable universe. There is no good known reason it stops there, and a billion years from now it will have expanded.
See the figure for the red shift and distances here at https://en.m.wikipedia.org/wiki/Distance_measures_(cosmology)#/media/File%3ACosmoDistanceMeasures_z_to_1e4.png
Hope this helps get some thing un-confused.