Anecdotally, I'm still running a computer I mostly bought in 2011, i5-2500K still going strong, but the motherboard has a few issues: one of the PCI-E slots works sometimes, one of the RAM slots is completely broken, and the RTC seems to lose a few minutes a week.
CPUs should go pretty much forever, provided they're run on clean power. They're a little square, entirely encased. Motherboards are bigger and with physical connectors you need to use force on.
I'm also on an i5-2500K from 2012, I only upgraded the GPU so far. I recently ordered a new pc for roughly the same price as the one i built in 2012, curious to see how much of a difference I will notice day-to-day.
CPUs should go pretty much forever, provided they're run on clean power. They're a little square, entirely encased. Motherboards are bigger and with physical connectors you need to use force on.