PC hardware, if cared for, will generally way outlast its usefulness. That GTX 1050 ti will most likely be unable to properly run future new games at playable settings before it physically dies. As an example, A friend has an old Windows PC, from 1997, I think, that still works. The hardware still functions perfectly, but the PC is nearly unusable now due to how much tech has advanced around the hardware.
The exception to this is manufacturers error, or if the parts were/are mistreated. Extreme overheating or a bad PSU can cause one to die, like another friend on mine. He bought a GTX 1050 I had used for 2 years, with no issues. His prebuilt that he put the GPU into had a very weak, poorly made PSU, and poor airflow case with little ventilation. The GPU died in 3 months. Take care of your components, and they will usually outlast their useful lifespan.