Sonication time is determined based on several factors including the type of nanoparticles, their concentration in the solvent, the power of the sonicator, and the nature of the solvent itself. Empirical testing and optimization are often necessary to determine the ideal sonication time for a specific application.