All perfect praise be to Allaah, the Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
Undoubtedly, swallowing blood that comes from the gums invalidates the fast and it is not overlooked like saliva; rather, it is just like a drink.
Thus, whoever deliberately swallows blood coming from the gums must make up for that fasting day. Moreover, according to the consensus of scholars, blood is something impure and swallowing it is prohibited even during ordinary days.
When your gum bleeds, you must spit out the blood even if you are on a means of transportation or in a study hall using the tissues and the like.
We advise you to do your best to seek medical treatment by visiting a reliable doctor and we ask Allaah The Almighty to cure you.
You must make up for the fasting days when you swallowed that blood deliberately. As for the number of days, then you have to fast until you believe that you have most likely freed yourself from liability.
However, some scholars have said that if one has doubts as to the validity of his fasting, he would not be required to make up for such days, because in principle fasting is valid unless proven otherwise. Shaykh Ibn ‘Uthaymeen adopted this opinion, which is a very strong one. However, the first opinion, that is making up for the days of fasting until you believe that you have most likely freed yourself from liability is more prudent.
Finally, if you swallowed the blood unintentionally without negligence in spitting it, then your fast would be valid.
Allaah Knows best.