We don't know exactly, but it's more than a few times
The Hollywood Reporter asked this question of screenwriter Jon Spaihts, who responded:
There is a deliberate ambiguity there. It's one of those places where you want not to over explain. But I think he [things] dozens of times, if not hundreds of times in there. I think he really gets a taste of eternal sacrifice and sticks to his guns.
And Empire Online sat down with director Scott Derrickson, who said that a deleted line would have revealed that they'd gone through the loop thousands of times:
"We had a line," recounts Derrickson, "where Strange said, 'we've been through this a thousand times. Literally. I fancied the idea that they went through it thousands of times before Dormammu finally realised he wasn't going to get out of it."