From the wiki:
Sanguinare Vampiris is the disease that eventually culminates in vampirism and is typically contracted when attacked by a vampire, either with physical attacks or being subject to their Vampiric Drain spell. If one is attacked by Vampiric Drain, there is 10% chance of infection.
Also, if you have Dawnguard installed, it can be contracted by drinking from the bloodspring in Redwater Den.
There are multiple ways to cure this:
Cure disease potion
Activating any shrine
Becoming a werewolf (talk to Aela The Huntress)
Going to Falion in Morthal
Console commands: From the wiki:
Another way of curing vampirism is via console commands; open the console and type, setstage 000EAFD5 10. By using the console command code showracemenu to change the Dragonborn's race, vampirism is immediately removed. This is also true of the changesex command.
It should be noted that the first two methods only work if you've not yet become a full-fledged Vampire (in the first 3 days after contracting the disease).