I reckon practically forever as long as they don't get too many care mistakes - basically, leaving a bar empty after the attention light has turned off. Since the start of the connection models, tamagotchis only die due to neglect instead of having a predetermined lifespan, as was the case with the vintage models (the Tamagotchi Mini is an exception to this as it has a predetermined lifespan). The colour models have likely kept this trait since they pretty much have the same lifespan functions and the same mindset making them.
I can personally attest to the connections being to live forever with good care, since I've kept two different connection models alive for over a year (one of them is still living with me and she was born on June 13th of 2017). Additionally, this trait is well known enough to have spawned the Long-Lived Oldies challenge, wherein people try to keep their tamagotchis alive for as long as possible and their tamas eventually evolve into seniors once the matchmaker is refused (hence the "oldie" part). After the first colour model, the senior stage has been removed so now an unmarried colour tamagotchi will stay the same character as it was in adulthood. That's quite a reasonable change ever since the gene mixing function was introduced, since imagine the disappointment in seeing a totally unique tama change into a shriveled apple of a senior! (I find the traditionally oldies look like shriveled apples.)