You can check the shutter count on most DSLR's, there is a sequence which you will be able to find online, you might also find the average/expected lifespan of individual DSLR's online too, so if you are buying used then make sure to ask the owner about this. I think it depends on model and naturally the more expensive the camera the better quality the components that are likely to wear out, for example the Nikon D3100 shutter has been tested to i believe 100,000 actuations, whereas the D7000 has been tested to 150,000 actuations,
That doesn't mean they will last that long, there are many factors that will influence this, If you live by the sea for example i would expect a much shorter lifespan since the salt in the air could corrode or wear components, plus there are many other components that could fail a long time before these shutter actuation numbers.
Older film cameras were generally built much better than todays cameras unless of course you buy professional grade models, They are crammed with electronics whereas older film cameras were mostly mechanical, The chances are the electronics will fail long before the shutter gives up, but like all things if it has been properly cared for, never dropped, and properly used then there's no reason why you won't get a good deal.