It’s unclear whether messages will be editable forever or within a certain time window.
WABetaInfo claims the feature is not even available for beta testers yet, but will probably show up fairly soon. It should also become available on WhatsApp for iOS, as well as the app’s desktop version.
WhatsApp added the ability to delete sent messages five years ago, but the new feature should be useful in those situations when you need to edit a typo without deleting and re-sending the message (potentially confusing the receiving party).
As for Twitter, we just have to mention it in the context of editing sent messages. It’s something Twitter has been working on for a while, and recently there have been signs that the feature might actually launch soon.