The movie showed approximately a dozen of these loops (I’m not sure about the exact number), but there was nothing to indicate that the two of them have gone through this routine 1,000 times or more.
Nevertheless, eventually Dormammu agreed to Doctor Strange’s demands in exchange for ending the torture.
To put an end to the destruction, Stephen ventured into this other reality and set a time loop before he came to Dormammu to bargain for Earth’s safety.
The entity wasn’t in the mood for discussion and immediately killed the sorcerer, but thanks to Stephen’s skillful use of the Eye, they were stuck in the same moment over and over again.