According to Nintendo President Tatsumi Kimishima, the switch will be supported longer this time. It should be more than six years at best.
Tatsumi Kimishima, president of Nintendo, has revealed that they want to support the switches for more than five or six years. In general, Nintendo consoles of the recent past have not been supported for much longer than six years: GameCube (2001-2006), Wii (2006-2012), and Wii U (2012-2017).
Of course, the switch has a good run at the moment, but the Wii had that, too, until the support flattened again. So you can be curious what will happen in the next few years with the switch.