People with OCD stick with a number for their rituals because that number feels right or is comfortable for them.
They may think certain numbers, or multiples of that number, are safe, and therefore they only do things that number of times.
Why that specific number is chosen may be random (they may have done a ritual a certain number of times one day and later remembered that it felt good, so they stuck with it), or there may be a meaning attached to it (because there are that many members in their family, they need to do it that many times to be sure that all of the family members are safe).
Not all people with OCD do things a certain number of times, some just keep doing rituals until they feel as if they were done just right or perfectly.
Others just have to do them for a set number of times, and some need to do both, they have to do the rituals for a certain number of times perfectly before they can stop the ritual.
If even one ritual is done wrong, even if it is the last in the series, they will often start all over again, continuing until the series is completed perfectly before they will go on to do the next ritual or task in their day.