tl;dr We put the indicator on all the posts you make within your first week of posting. The indicator stays on each post for a week. Deleted posts aren't considered when determining if it's your first week.
I'm going to give you the technical spec and then answer the questions individually.
This indicator is a bit that's added to posts when they are created. To set the bit, we look for a user's oldest non-deleted question or answer. If one doesn't exist or that found post is less than a week old, we mark the post as
OwnerIsNewPoster. So, basically, all your posts for the first week will be marked as "by a new contributor".
We show the indicator only if all of the following criteria are met:
- Indicators are enabled on the site. Right now Stack Overflow for Teams and Stack Overflow Enterprise do not get the indicator.
- The post is marked as
- The post is not a community wiki.
- The owner is not deleted.
- The post is less than a week old.
So, to answer your questions:
How old does one's first visible post have to be for the indicator to be removed?
The indicators only appear in your first week, and each disappears after a week. So after two weeks you will have no indicators on the site.
Is the indicator status calculated on the fly when loading a post, or is it permanently attached to a post and only removed on later posts?
The indicator is permanently attached to the post but is not rendered on the site.
Finally, what happens if the first visible post gets deleted? Is the calculation still based on that post, or is it based on the next post that continues to be visible? In other words, if I posted a few years ago and later post again, and I delete my post from a few years ago, will the indicator start showing up?
Deleted posts aren't considered in the calculation. If you were to delete all your posts right now (please don't) and posted a new one, it would have the indicator. Funny enough, I saw this in the first post I checked on Meta. A post from 2011 got deleted in 2016 and the user asked again a few days ago.