There are two different engines used - M20 and M50. Both are excellent engines with few minor problems.
For M20 engines, the problem is the cylinder head mount bolts sometimes snaps and bounce around engine like ping pong ball (very bad engine damage) BMW released a fix, replacing these bolts with different style of bolts. Also need to replace timing belt every 60K miles. Provided that you address the two problems, and don't over heat the engine, it will last upper range of 300K miles.
For M50 engines, the common problem is the oil pump bolt coming loose. every 100K so, you would need to lower the oil pan, and tighten this bolt. You can also take it out, and reinstall the bolt with loctite. I also seen some people drill a small hole in the middle of the bolt and insert a holding cotter pin. The weak point of the engine is use of plastic components (thermostat housing, radiator, and water pump) These plastic parts gets brittle over time and cracks, sending hot coolant all over the engine. So on top of the oil bolt, you should replace radiator, thermostat housing, water pump (only impeller is made out of plastic) every 80K - 100K miles. Personally, I've seen these cars up to 250K miles so I can assume that the car would last up to 300K miles or more if taken care of.
How long you can keep the car depends on your mechanical ability. I have been servicing BMWs for 10 years and only two things I cannot do is rebuilding the engine and the transmission. Big stuff like blown head gasket or clutch replacement still runs me couple hundred dollars. For most people, $1500 for cylinder head rebuilding is the throw out point (choose to throw out the car rather than fixing)
If the car has automatic transmission, it will die before the engine. This can set you back several thousand dollars.