As long as it takes.
If you want specifics, there's a short window of opportunity, usually anywhere from a few seconds to a minute where you can edit your posts without getting an 'edit' time stamp. Otherwise, take all the time you need to edit posts.
You can quick edit using the edit button and have the edit window appear within the thread. After that click on 'save'.
If you want more options, just click on 'go advanced.'
Filling in the 'edit reason' is optional.
After you edit your post, a time stamp will be made noting the date and time of your edit.
The only places you can not edit your own posts are in the Hall of Shame and the Auction House.
From my experience, the time you get to edit your post is flexible, going up to 5 minutes from the original post before getting an edit time stamp. HOWEVER, if a registered member is also visiting the forum, it's anybody's guess. I'd guess it depends on whether your post is being read. Once a post has been made after your post, the edit time is zero.
Of course, you can go back and edit your previous posts whenever you want. Whether anyone notices is another question.
Good etiquette is to never edit a post once someone has posted a reply to your post.
For example, I've edited this post twice since my original. The edit time stamp will be whatever it is currently. Nobody has replied to my post.
HOWEVER, should you edit your post after somebody has posted a reply, leave your original post untouched and append anything you want to add with the preface "EDIT:" Simple, no?
Gee, guess that makes three edits now.