The current official answer from the BBC would be that there have been 11 versions of the Doctor, with the possibility that an individual known as the Valyard might have been a future version of the Doctor seen in "The Trial of a Timelord", and that the Tenth Doctor helped to create two additional different versions of himself in "Journeys End".
However, there are many "unofficial" versions of the Doctor that have been seen in spin-off material, not generally seen as part of the established television "canon". The most prominent is likely the character called "Dr. Who" (portrayed by Peter Cushing) in the 1960s Dalek films. Next in terms of prominence bight be the 9th-13th Doctors seen in the BBC-made spoof, "The Curse of Fatal Death". Then there was the at-the-time-official Ninth Doctor, played by Richard E. Grant, in the BBC webcast, "The Scream of the Shalka" — but his "official" status was revoked when the 2005 series identified Christopher Eccleston as the "true" Ninth Doctor.
The Big Finish audio series has posited several "alternative" Doctors in their Doctor Who: Unbound series. And there have been a number of prose works which have likewise posited Doctors who cannot be readily identified as any one that has officially appeared on television.
An exact count of the total number of Doctors who have appeared in BBC-licensed material outside of the main television program would be laborious in the extreme. Hoeever, it is probably no exaggeration to say that at least 50 separate Doctors can be identified in material sanctioned by the BBC.