Photogranules are dense, spherical agglomerates of cyanobacteria, microalgae and non-phototrophic microorganisms that have considerable advantages in terms of harvesting and nutrient removal rates for light driven wastewater treatment processes. This ecosystem is poorly understood in terms of the microbial community structure and the response of the community to changing abiotic conditions. To get a better understanding, we investigated the effect of hydraulic retention time (HRT) on photogranule formation and community assembly over a period of 148 days. Three laboratory bioreactors were inoculated with field samples from various locations in the Netherlands and operated in sequencing batch mode. The bioreactors were operated at four different HRTs (2.00, 1.00, 0.67, 0.33 days), while retaining the same solid retention time of 7 days. A microbial community with excellent settling characteristics (95–99% separation efficiency) was established within 2–5 weeks. The observed nutrient uptake rates ranged from 24 to 90 mgN L−1 day−1 and from 3.1 to 5.4 mgP L−1 day−1 depending on the applied HRT. The transition from single-cell suspension culture to floccular agglomeration to granular sludge was monitored by microscopy and 16S/18S sequencing. In particular, two important variables for driving aggregation and granulation, and for the structural integrity of photogranules were identified: 1. Extracellular polymeric substances (EPS) with high protein to polysaccharide ratio and 2. specific microorganisms. The key players were found to be the cyanobacteria Limnothrix and Cephalothrix, the colony forming photosynthetic eukaryotes within Chlamydomonadaceae, and the biofilm producing bacteria Zoogloea and Thauera. Knowing the makeup of the microbial community and the operational conditions influencing granulation and bioreactor function is crucial for successful operation of photogranular systems.