The first time that the narrator "swoons" is right at the beginning of the story, after he has sat in the room with the judges for quite some time. He is imagining a death sentence, and the thought of it is so terrifying that it makes him sick. He is watching the judges, in a severely disorientated state, when he passes out. He writes of the event,
"I had swooned; but still will not say that all of consciousness was lost. What of it there remained I will not attempt to define, or even to describe; yet all was not lost."
So, he fainted, but still had a bit of his capacities with him, enough to describe feeling like he was being lowered into something. That turns out to be his prison.
The next pass-out occurs after he awakes in total darkness in his prison. His imagination runs wild, and he chances upon the terrifying thought that he might have been buried, in a casket, alive. That scares him so badly that he again faints. Next, he falls asleep a couple times; I don't know if you are counting that for "losing consciousness" or not. His torturers then drug him; that makes him super sleepy and he passes out again. During the time he is out, they arrage him on the plank in order to enact the pendulum torture. He swoons one more time while he is tied to the planks.
So, that makes, in actual fainting or passing out from being drugged, a total of four times. If you don't count the being drugged part, that's three. Having never fainted before, it's beyond me, but then again, I've also never been tortured and held captive by evil tormentors. I'd probably faint too. I hope that helped; good luck!