They last about as long as the anode rods do, or roughly 6-10 years.
So if you change the anode(s) about every 6 years, you should get
about 20 years from the heating elements. There are lifetime
warranted elements and also elements that won't burn out if you
accidentally turn on the electricity before the heater is completely
full of water. http://www.waterheaterrescue.com/ has info about