This feature already exists. Look under user preferences at the bottom of the page.
However, you can only delete your account when it is new. See the relevant site settings to adjust those thresholds.