A few weeks: The male goldfish will likely continue to chase the female until she is ready to mate. Once the female is ready, she will release her eggs and the males will fertilize them.
Several weeks: If the male goldfish do not successfully fertilize the eggs, they may eventually give up and leave the female alone. However, if the male goldfish are successful, the female will lay multiple batches of eggs and the males will continue to chase her until she has released all of the eggs.
The entire breeding season: In some cases, the male goldfish may continue to chase the female for the entire breeding season, which can last for several months. This is most likely to happen if the female goldfish is not releasing her eggs or if the males are not able to successfully fertilize them.