The effects of hydraulic retention time (HRT) on the performance of algal-bacterial-based aquaponics (AA) were investigated in this study. Both the highest fish growth and algal biomass increase were observed in the AA system at 2-day HRT, resulting in the highest nitrogen utilization efficiency (NUE) (39.28%) in this microcosm. On the contrary, ammonia oxidation bacteria (AOB) abundance at 4-day HRT was approximately ten times higher than that at 2-day HRT, since longer HRT would benefit bacterial growth. The N labeling study showed that microalgae assimilation was the main pathway of NH removal in the AA system, and oxygen produced by microalgae could in situ support complete nitrification, thus leading to much lower NH concentrations at 2-day HRT. Accordingly, better water quality was achieved at 2-day HRT. Considering all the factors, HRT of 2-day was considered to be optimal for the AA system.