The general answer for electronic devices is that they have a "bathtub" curve that represents the expected life of any particular design. Early life failures (first few months) are relatively high. Then the failure rate drops very low and stays that way. Then after some number of years, the failure rate starts climbing again. From an RV point of view, if you're post-warranty, most of your electronics will probably last as long as you have the trailer - barring external issues such electrical surges, or high or low voltage conditions that can damage the electronics. Devices like fireplaces, microwaves, and DVD players that have both electronic and mechanical parts, may have a shorter life.
More specifically, if you're asking about the inverter that's dedicated to the residential refrigerator, the reason to leave it on while on shore power is to protect food from spoiling in the event of a power failure. If the refrigerator is empty while the rig is stored at home, the inverter may have a longer life if it's turned off.