If you're still learning or giving opportunities to learn new things, stick it out. If you're stagnating and not allowed to learn new things, it's time to leave.
For the first 10 years or so, this is relevant. After that you can figure out what you really want to do.