This isn't a rule or anything, but generally:
(1) If you achieve mainstream, pop chart-type popularity, it's not likely to last very long, unless you can transition into one of the other categories. Those artists tend to appeal to younger audiences and more casual listeners, and what's in and out is very similar to fashions being in or out.
(2) If you can appeal to or grow a "cult" following, you can remain successful much longer as long as your cult following does not perceive you as selling out. They can perceive you as selling out either by you changing the type of music you're doing (if you're cult is not of a type that cherishes you for your diversity), and/or by achieving (1)-type success (which can sometimes happen accidentally). There will still be some attrition as members of your audience age and gravitate to other interests, but especially if you've been around awhile, your audience will tend to turn younger people onto you and they'll be absorbed as part of the cult audience
(3) Some genres attract people who tend to be life-long fans as long as you're doing quality work in the genre. These tend to be (a) genres that are focused on having a high degree of technical skill--like jazz and classical, and (b) genres that have cult audiences, but where they're more cult fans of the genre than of particular artists--for example, blues. (b) also covers some genres that are difficult to consider "cult", because they can sell more albums than (1) above, but they tend to be genres that are perceived as endemic to particular cultures and geographical locations, like country and latin music. Fans of these types of genres will typically stick with you as long as you are doing quality work (quality work isn't as imperative in (1) and (2)--you can have chart success and be fashionable, or appeal to a cult audience without having much in the way of traditional skills), and you do not move too far outside of the genre (like a jazz artist deciding to do bubblegum pop tunes all of a sudden--there's a lot of leeway in the types of jazz they can do, though). "Musicians musicians" also tend to fall in this category.
(1) is the category where people tend to make the most money, but it's a lot of money for just a short period of time. With (2) and (3), you make more modest money, but indefinitely as long as you're careful not to alienate fans. The rarest thing is the artists who achieve (1)-type success indefinitely--like the Rolling Stones (and the Beatles would have had it if they hadn't broken up), and second rarest is achieving (1)-type success and then moving to a sustained (2) career--many classic rock bands have managed that. Category (2) is where you need to be the most careful about not being perceived as "selling out".