Determine Membership Roles... how does this work?

Hi Support Team,

am wondering how does the assignment of membership roles work. I recognized that a visitor gets automatically after signing up first time gets the VISITOR role assigned.

When does this visitor role change? After first payment or already when choosing e.g. a GOLD membership but fails to pay?

Please be so kind explain the assignments a bit more.

Thank you.
Prinz