With regard to uncertainty about the number of circuits performed, one of two scenarios must apply:
1. He is still performing the act of worship. In this case, he should proceed on the basis of the lesser number. If he is not sure whether he did five or six circuits, he should assume that he did the lesser number, i.e., five, because this is what is certain, but there is some doubt about the higher number (i.e., six). The evidence for that is the words of the Prophet (blessings and peace of Allah be upon him): If one of you is uncertain about his prayer and does not know whether he prayed three or four (rakahs), let him ignore the uncertainty and proceed on the basis of that which he is certain of.
Narrated by Muslim, 888
Ibn Qudaamah (may Allah have mercy on him): If he is not sure of the number of circuits, he should proceed on the basis of what he is certain of. Ibn al-Mundhir said: All of the scholars from whom we learned are agreed on that. And because it is an act of worship, so if one is uncertain about it whilst still doing it, he should proceed on the basis of what he is certain of, as in the case of prayer.
End quote from al-Mughni, 3/187
2. If the uncertainty arises after one has finished the act of worship. In that case he should not pay any attention to it, according to the correct scholarly view, because the basic principle is that acts of worship are free of shortcomings, so that one will not open the door to waswasah (whispers from the Shaytaan).
It says in al-Mawsooah al-Fiqhiyyah, 29/125: If he is uncertain after finishing tawaaf, he should not pay any attention to that, according to the majority of scholars, apart from the Maalikis who regarded doubt during tawaaf or after finishing it as being the same. End quote.
Shaykh Ibn Uthaymeen (may Allah have mercy on him) said: Uncertainty after completing an act of worship does not mean anything. For example, if a person is unsure as to whether he did five or six circuits of tawaaf, we say: If that arises during tawaaf, he should do that which he is uncertain of, and that is the end of the matter. If that arises after he has finished tawaaf and moved away, and he says: By Allah, I do not know whether I did six or seven circuits, that uncertainty does not mean anything. So he should ignore the uncertainty and assume that he did seven.
This is a useful principle: if a person feels a great deal of uncertainty, he should not pay any attention to it, and if the uncertainty arises after he has finished the act of worship, he should not pay any attention to it unless he is certain. If he is certain then he has to do what he omitted.
End quote from Fataawa Noor ala ad-Darb
And Allah knows best.
Reproduced from Islam QA