Proverbs 3:2 For length of days, and long life, and peace, shall they add to thee.
The condition is stated in verse 1: “Forget not my law and keep my commandments.” If you do so, then long life and peace shall be added. But who is speaking “my law and my commandments?” Solomon, God, or Wisdom? Solomon is writing these proverbs and promises under the inspiration of the Holy Spirit. So God the Lord is actually speaking as Wisdom. The Wisdom of God (for NT believers) is Jesus, the Son of God [1 Corinthians 1:30]. Therefore, the Trinity is personally speaking to each of us as His children: Keep My Law and My Commandments and they will add long life and peace to you.
The conditional promise is explicitly stated in the Fourth Commandment, “If you Honor your parents, then you will live long in the land (Kingdom).” In Proverbs, God says we may enjoy the promise of a long and peaceful life if we keep all the Commandments.
The promise comes true for us in two ways: physically and spiritually, temporally and eternally. First, a long and peaceful life on earth means a full, rich, abundant, and meaningful life, no matter how many literal years it lasts. Second, a really long and really peaceful life in the kingdom of heaven means the eternal life of God that is ours now in the heart and lasts forever in reality. Thankfully, Jesus lived a perfect Law-keeping life for us, and on account of Christ God gives us perfect righteousness. Believers in Christ enjoy the blessings of a “long” life on earth for a short time and the joys of a “really long” life in the Kingdom for a very long time.
The bottom line in simple words: Listen to Jesus for a good life.