How about 7 minutes? That's long enough that the reasonable part of your brain has had adequate time to think "mmmh, maybe this was not such a good idea *delete*" and short enough that there statistically speaking are not loads and loads of replies to it. And no loads and loads of replies means that in the event of deletion there are not loads and loads of replies that suddenly are out of context.
I think it needs to be 12-24 hours. So if you post something dumb before you head to sleep, you can remove it when you wake up.
Mmmh, usually when it's something really dumb, you will get (or rather, I usually get) an internal reminder within that ~7 minute timespan. It basically (IMO) is about balancing what the poster of the to be deleted thread wants vs the rest of the thread participants.
You did plonk it out there in a public forum. If you notice it within a few minutes, okay just delete it, none the wiser. If after 12-24 hours people have already seen it and replied to it IMO it is nicer to not delete it. In that case the poster can still edit it and leave a one liner of "disregard old post, needed sleep" or some such.
For the other scenario of "but it's my post and I want to be able to remove the content a week after I posted it" I really suggest people can just use the edit button. That way the user's mission of "must delete content" is still completed, AND for the rest of the thread participants there is still enough coherence left because they can see the edited post. Seems a reasonably balanced solution to me, but that's just my opinion.
What if a user requests to close there account and have all their posts removed?
This has happened before, and I think it's their right to ask for that, so I always comply. Unlike some forums, I do have a clause that says the information you enter belongs me *insert evil laugh*
In which case, does it make sense not to allow post deletion at any time?
In which case personally I would comply as well and do a delete all. Annoying, but such is life. And yes, it still does make sense to not allow post deletion at any time, even if you have as policy that you will comply to requests to nuke an entire account.
Even there you could make a script that 1) changes username to "anonymous deleted user" and 2) replace thread text with "removed upon user request". That way you still have a semblance of coherence in the thread and .... google can actually find something with the correct post number after a big nuke fest.
To clarify: with thread coherence I mean that after an alteration (delete or edit) other people don't get confused by things that are suddenly waaay out of context. I noticed on this and other forums that multiple deletes is a great way to add extra confusion. On the other hand the same number of edits (basically delete content, leave empty post) is significantly less confusing.