Then there is Cher, who has had 52 charting singles (Billboard Hot 100) so far, from 1965 to 2023.
The Rolling Stones have charted singles from 1963 (UK) to 2023, so their hits also span 7 decades.
On the songwriting and production side, there is Max Martin, who has written or co-written 27 #1 hits (Billboard Hot 100) so far. The first one was for Britney Spears in 1998, and the most recent two (!) were for Ariana Grande in 2024.