basically when it's done. You're edge will be missing the actual edge and will still have a bit extra over that but not a lot. The shape is done, everything's smooth and clean. It doesn't need a super fine finish, but a 120-220 grit finish helps reduce how much you have to do after HT and makes it easier to see problems before they're a lot tougher to remove.
My last half dozen knives have been taken a lot closer to done before HT than I did in the past, and it's definitely made my life easier. My time from taking a heat treated knife to ready to mail has been cut drastically along with far less sandpaper used, fewer belts worn out and an overall increase in productivity. For obvious reasons, steel's easier to work before it's hardened. A scratch heat treated just like the higher surfaces, so now you've got to grind all that extra steel, now hardened, to get below the scratched point PLUS clear off the decarb layer at its base. trust me, as someone who used to be insufficiently anal before HT, it's easier and faster to do the work first and just be cleaning up the results of the HT after.