The specific environment of galaxies may play a key role in their evolution. Large extragalactic surveys make it possible to study galaxies not only within their local environment, but also within the large-scale structure of the Universe. We aim to investigate how the local environment influences the star formation history (SFH) of galaxies across a range of large-scale environments. We categorised a sample of 9384 galaxies into the three primary large-scale structures (voids, walls and filaments, and clusters). We further classified them based on their local environment (as either 'singlets' or group members) through a search of companion galaxies within sky-projected distances of $ r_p < 0.45$ Mpc and velocity differences of $ v < 160$ $ km s $. Subsequently, we explored these subsamples using SFH data from previous works. Throughout this study, we divided galaxies into long-timescale SFH galaxies (LT-SFH), which assemble their mass steadily along cosmic time, and short-timescale SFH galaxies (ST-SFH), which form their stars early on. We then compared their characteristic mass assembly look-back times. The distributions of mass assembly look-back times in ST-SFH galaxies are statistically different for singlets and groups. These differences are only found in LT-SFH galaxies when studying these distributions in stellar mass bins. Our results indicate that the large-scale environment is related to a delay in mass assembly of up to sim 2 Gyr, while this delay is $<$1 Gyr in the case of local environment. The effects of both types of environment are more significant in less massive galaxies and in LT-SFHs. Our results are consistent with galaxies in groups assembling their stellar mass earlier than in singlets, especially in voids and lower mass galaxies. Local environment plays a relevant role in stellar mass assembly times, although we find that large-scale structures also cause a delay in mass assembly, and all the more so in the case of cluster galaxies.