Magic

Magic was a framework for understanding and altering reality based on irrationality, ritual and will.

Cosmological status
Magic formed part of the fundamental 'operating system' of both the universe which existed before the Doctor's own and the universe which would would eventually follow it. (MA: Millennial Rites) Some universes which existed 'sideways in time' were also magic-based. (DW: Battlefield)

It was initially a strong force within the Doctor's universe, back in the time of the Pythia, but as the Time Lords rose to shape that universe, its principles were replaced by those of science as that which underpinned reality. (NA: Cat's Cradle: Time's Crucible, Christmas on a Rational Planet)

Had the Ferutu, rather than the Gallifreyans, become the Lords of Time, then the universe would have continued along magical principles. (MA: Cold Fusion)

Within a Rational Universe
The Doctor claimed not to believe in magic (DW: The Dæmons, MA: The Sorcerer's Apprentice) and endorsed Clarke's Law. (DW: Battlefield) Indeed, most instances of the supernatural encountered by the Doctor's first seven incarnations eventually stood revealed as the effects of alien science, be they the psychic powers and technology used by the Dæmon, Azal (DW: The Dæmons), or the nanotechnology of Elbyon. (MA: The Sorcerer's Apprentice)

Yet the Seventh Doctor was not entirely inflexible on the matter, as evidenced by the corollary he added to Clarke's Law stating that any sufficiently advanced form of magic is indistinguishable from technology. (DW: Battlefield)

One of the many sources of contention between Gallifrey and Faction Paradox was whether or not the rituals the Faction employed genuinely invoked voodoo spirits called loa, or whether the Faction were simply personifying the scientific principles with which they were engaging. (FP: The Book of the War)

Psionics was originally a species of magic, but survived the rationalisation of the universe through being sufficently grounded in science. Monitoring the network of connections that psionic abilities established across time allowed the Time Lords to possess an 'early warning system' against outbursts of wilder magics breaking through into their ordered cosmos. (NA: So Vile a Sin)

After Gallifrey
Following the first destruction of Gallifrey (EDA: The Ancestor Cell) then the Time Lords' exorcism of the irrational from the universe was revoked and magic regained its potency. (EDA: The City of the Dead, The Adventuress of Henrietta Street)

It is unknown whether the same has happened following the second destruction of Gallifrey in the Last Great Time War. Certainly, the Doctor was initially prepared to consider the linguistic-science of the Carrionites to be witchcraft. (DW: The Shakespeare Code)

Elsewhere, Clarke's Law continues to be the order of the day. The Sycorax's form of blood control was understood by both a member of UNIT and by the Sycorax themselves to be supernatural. The Doctor's regenerative abilities were also taken for witchcraft. (DW: The Christmas Invasion)

On a number of occasions the Doctor appears to have suggested that a magical and a scientific understanding of the same phenomenon are now interchangable. (DW: The Girl in the Fireplace, Tooth and Claw) Others have made the connection too, Elton Pope noting that the sonic screwdriver is essentially a magic wand. (DW: Love & Monsters)

The Doctor still lists spells, rituals and incantations among those things in which he personally does not believe, but remains prepared to consider that they might nevertheless be real. (DW: The Satan Pit) Jack Harkness considers some phenomena, such as Fairies, to exist outside the bounds of scientific inquiry. (TW: Small Worlds)