It's presumably at some point between the specials The Waters of Mars and The End of Time, because at the end of The Waters of Mars he's standing in a snowy street on Earth and suddenly sees a vision of Ood Sigma standing there, then at the beginning of The End of Time the TARDIS materializes on the Ood homeworld, and looking at this transcript, here was the first bit of dialogue between them:
DOCTOR: Ah! Now, sorry. There you are. So, where were we? I was
summoned, wasn't I? An Ood in the snow, calling to me. Well, I didn't
exactly come straight here. Had a bit of fun, you know. Travelled
about, did this and that. Got into trouble. You know me. It was
brilliant. I saw the Phosphorous Carousel of the Great Magellan
Gestadt, saved a planet from the Red Carnivorous Maw, named a galaxy
Alison. Got married. That was a mistake. Good Queen Bess. And let
me tell you, her nickname is no longer. Ahem. Anyway, what do you
want?
SIGMA: You should not have delayed.
DOCTOR: The last time I was here you said my song would be ending
soon, and I'm in no hurry for that.
"Good Queen Bess" was one nickname for Queen Elizabeth (see this book for example), and "The Virgin Queen" was another, which is probably what the Doctor was jokingly referring to when he said "And let me tell you, her nickname is no longer. Ahem." So apparently the marriage to Queen Elizabeth was part of his "I didn't exactly come straight here" adventures, procrastinating on hearing what Ood Sigma had to tell him because last time the Doctor had met him in the flesh, in "Planet of the Ood", Ood Sigma had told him "I think your song must end soon." (likewise, in Planet of the Dead, the psychic Carmen had told him 'No, but you be careful. Because your song is ending, sir.')