It's dependent on when Switch 2 launches.
The most likely quarters for Switch 2 to launch (in this order)
1. Q4 2024
2. Q1 2025
3. Q3 2024
First-party software will continue through 2025, maybe even 2026. Hardware won't be discontinued until 2027 or 2028. eShop will probably be open a long time still since Nintendo might build Switch 2's eShop off of Switch's eShop.
Lifetime Sales Predictions
Switch: 161 million (was 73 million, then 96 million, then 113 million, then 125 million, then 144 million, then 151 million, then 156 million)
PS5: 115 million (was 105 million) Xbox Series S/X: 48 million (was 60 million, then 67 million, then 57 million)
PS4: 120 mil (was 100 then 130 million, then 122 million) Xbox One: 51 mil (was 50 then 55 mil)
3DS: 75.5 mil (was 73, then 77 million)
"Let go your earthly tether, enter the void, empty and become wind." - Guru Laghima