What is the “new contributor” banner below some user's names, and for how long does it last?

The title says it all, but I wasn't able to find any place or wiki where it was described what exactly is "new contributor" banner?

I came across a profile, where the user was a member for 7 months (I don't exactly remember), but wasn't previously active for quite sometime and had this banner. So what does it depend on? And for how long does it exist?

The "new contributor" indicator was first announced on August 2018 on Meta Stack Exchange: Come Take a Look at our New Contributor Indicator!:

tl;dr;: Folks will see an indicator when they go to interact with new contributors (visible for a week following their first post) letting them know that the person is new. A handy link to our Code of Conduct will be in the notification for reference.

(emphasize mine)

The indicator will be shown for a week after the user's first post. This also means, if all their posts get deleted (e.g. posting "not an answer" answers), the duration will be reset, and it will be shown again when the user post their "first" post.

The new indicator works by the age of a user's first visible post.

This could be a question or answer, and the association bonus won't influence the behavior. While you might not be new to our engine, everyone is new when they first join a new community, so the indicator is shown.

Also, just as you have observed, the user's age ("member for") is irrelevant. And lastly, main site and meta site are separated; you will always be a "new contributor" on the meta when you post for the first time regardless if you have posted many questions & answers for years on the main site.