Cusstom ROM's will be updated until dev's don't own the phone any more. Go look at the Evo section, there are still custom ROM's being made, and that phone is old.
As far as official updates, Apple ends at the 3 year mark. iOS7 runs on the iPhone 4, so that's 3 years, but nothing older. I'm sure 8 will not work on anything older then 5.