I did believe that River Song knew his name because she was his wife, but after watching SITL/FOTD again, I'm now leaning toward her knowing his name because she was there when he died, as in final death.
When River whispered in his ear, her overall demeanor and his reaction didn't fit with people who were discussing a future/past marriage. They both seemed very solemn, as though what she had told him was bad news.
Then, later, during River's "death scene," the Doctor says (paraphrase)"You know my name. There's only one reason I would tell you my name. There's only one time I could."
If he literally means one time, one instance, then it couldn't be marriage, because that can occur multiple times. But he can only die once.
Maybe it's a ceremonial thing, left over from the age of the Time Lords. Since they didn't normally share their real names, there would be no way to know when a time lord had died. So death would be the one exception, the one instance that a time lord would share, so that his name could be recorded for posterity.
Just a theory...