As light from a star spreads out and weakens, do gaps form between the photons
The answer depends on how you look at light. However, in the most accurate approach, gaps do not form between photons as light spreads out. Light is made up of tiny fundamental bits called photons. A photon is a quantum object. As such, a photon acts a little like a particle and a little like a wave, but is actually something more complex.
If you look at light as a collection of little particles, you could say that dimmer light has its photons more spread out. But, they are not spread out in space while traveling. Rather, they are spread out in time and space as they are received. A sufficiently sensitive photon counter device can detect the reception of light one photon at a time. Shine light at such a device and it does not receive the light as a steady stream. Rather, it receives the light as a series of discrete bundles of energy separated by gaps in time. Similarly, shine light at a sufficiently sensitive array of photon counters, and it receives the light at point locations with spatial gaps between them. When viewed in this way, a light beam always has gaps between its photons, whether the light be very bright or very dim. Very dim light beams have larger gaps in time and space between the reception of each photon compared to brighter light beams. Light from a very distant star has spread out over a very large area and become very dim in the process. The gaps between photon reception from a very distant, dim star are therefore large. Again, it is only the reception time and locations that has gaps. There are no gaps in space between the photons as they travel.
If you look at light as a wave, then there no gaps unless specifically placed there on purpose. Of course, if you repeatedly turn on and off a flashlight, the light beam coming from your flashlight will have gaps. Similarly, if you shine a continuous beam of light through a shutter that is repeatedly opening and closing, you can create gaps. But if you shine a continuous beam of light into free space, the wave will start with no gaps and therefore develop no gaps as it travels. Waves are field oscillations that are spread out smoothly through space. Spreading out a wave over a larger area just causes the wave strength to weaken, but does not cause gaps to form. Therefore, if you look at photons as waves, spatial gaps never form in light as it travels through free space, no matter how dim it gets. The light from a distance star indeed spreads out and weakens as it travels, but this just reduces the wave strength and does not introduce gaps.
A rough but helpful way to look at photons is that they act like waves while traveling and act like particles when interacting with matter. In the context of starlight, the light travels through space for millions of years acting like a wave, and then acts like a collection of particles when hitting the photon detector, the telescope, or an eye. Each photon therefore collapses from mostly wave-like to mostly particle-like upon being detected. Since the photons act mostly like waves while traveling, there are no gaps that develop between them while traveling. And since the photons act mostly like particles when being detected, there are gaps in the time when the photons are detected and in the locations where they are detected. The act of detecting the light causes it to collapse from wave-like to particle-like, and therefore introduces the gaps. A very dim light beam from a distant star has a very weak wave magnitude, which leads to large gaps in photon reception.