Those of us with 3G and old-bootrom 3GS phones will be able to upgrade to 4.0 and maintain our jailbreak almost immediately. If the release version of 4.0 is not susceptible to Spirit, then I imagine new-bootrom 3GS owners will have to wait for Geohot to release his jailbreak.
Since nobody can really start working on a jailbreak for the HD until it is released, I imagine it will be several weeks before we see a jailbreak for the new phone.