I figure that since it's a piece of advice that makes a lot of general sense it's probably been around for a while
Aristotle said "Moderation in all things" which I would imagine is a close enough paraphrase to answer your question.