Hi Jack,
Jack wrote
how far is the cabin top from the gooseneck
That's a bit variable. When I ordered my new sails from Jeckells in 2005 I made no specification about how big they should be. However, when delivered the main was distinctly bigger than the original 1974 sail. I've never measured it, but I'd guess there's a four inch difference in the length of the luff.
It's not a problem as there is a slide on the back of the mast, in which the gooseneck fits, and you just haul down on it until the luff is tight. The boom is now marginally lower than it was, but still clearly my head (I'm 6ft!) when gybing so I don't worry at all.
When reefing I roll the main around the boom. When you do that the sail hangs slightly differently and the back of the boom drops slightly, so there is a risk of it catching my head. Therefore I find myself raising the gooseneck by a few inches before hauling on the halyard.
In short I think the answer to your question is not a dimension so much as: whatever is sufficient to allow the boom to clear your head!