This phrase was quoted by Jerry Pournelle in an article entitled "Halfway to Anywhere" first published in the Galaxy Magazine in the April 1974 Issue in his column "A Step Farther Out". This article was then collected with others into his book of the same name.
Here's the article's opening:
One of my rivals in the science-writing field usually begins his columns with a personal anecdote. Although I avoid slavish imitation, success is always worth copying. Anyway, the idea behind this column came from Robert Heinlein and he ought to get credit for it.
Mr. Heinlein and I were discussing the perils of template stories—interconnected stories that together present a future history. As readers may have suspected, many future histories begin with stories that weren't necessarily intended to fit together when they were written. Robert Heinlein's box came with The Man Who Sold the Moon. He wanted the first flight to the moon to use a direct Earth-to-moon craft, not one assembled in orbit—but the story had to follow Blowups Happen in the future history.
Unfortunately, in Blowups Happen a capability for orbiting large payloads had been developed. "Aha," I said. "I see your problem. If you can get a ship into orbit, you're halfway to the moon."
"No," Bob said. "If you can get your ship into orbit, you're halfway to anywhere."
He was very nearly right.
You can also read the whole article.