My 2007 MBP is still going strong. I replaced it because I do advanced regression modeling and it was getting a bit long in the tooth for that. This said, it still works wonderfully for Microsoft office and web surfing.
Try not to buy in to the artificial demand apple tries to create by releasing new versions of OSX. In my opinion, very few of the release changes in OSX are must have features.
I would recommend you keep what you have until it breaks, or until YOU identify a need that it does not satisfy.
Joe
The problem is security updates. If your 2007 is still running El Capitan, it isn't receiving security patches anymore. I personally would not use it online.
For the OP, that machine will last about as long as you want it to. You may feel the RAM being cramped at some point, but honestly outside of professional work, it seems like we have plateaued with RAM usage for a normal user. 8 GB was what my midrange 2013 came with, and honestly even though I have 16 GB on my 2018, I don't need it and probably never will.
As you have guessed, the only limiting factor will be parts and macOS updates. Since it was manufactured up until 2018, it will become vintage in 2023 and obsolete in 2025. Vintage machines do not receive service from Apple unless you are in Turkey or California. Obsolete cannot receive service from Apple anywhere. Parts for both may be harder to come by. OS updates usually go for 7 years or so from release, so it should receive OS updates until 2023 (though it is possible it could be cut off sooner or go longer). Each OS receives security updates for 2 years after it was replaced. So at current release rates, assuming the 2015 gets a full 7 years of OS updates you would be looking at no longer receiving security updates around 2025, maybe 2027. At the point the machine does not receive security updates, I would suggest retiring it.
TL;DR: You should have until at least 2025 before it no longer gets security updates at which point it should probably be retired from use.