Thanks for your question.
The Bible has a lot to say about this. It does not definitively correlate the length of our lives with our obedience. However, Scripture does say that when we get on God’s page, his commandments are for our benefit and flourishing, and thus would be conducive to long life.
This just makes sense. If God is our Creator then he knows how the human machine runs best and his moral duties and commands are like the operator’s manual for ourselves and our lives with others. And to not follow the manufacturer’s instructions would lead to malfunction and shorter life. So Moses will say about God’s commands:
Follow the whole instruction the Lord your God has commanded you, so that you may live, prosper, and have a long life in the land you will possess.Deut. 5:33
And again God’s promise to Solomon:
If you walk in My ways and keep My statutes and commandments just as your father David did, I will give you a long life.”1 Kings 3:14
Again if you find God’s wisdom, you conform your life to God’s good way and it leads to happy outcomes including longer life:
13 Happy is a man who finds wisdom and who acquires understanding, 14 for she is more profitable than silver, and her revenue is better than gold. 15 She is more precious than jewels; nothing you desire compares with her. 16 Long life is in her right hand; in her left, riches and honor.Prov 3:13-16
Some of these promises should not be considered to be merely the special favor God supernaturally puts on the obedient. It’s that the obedient avoid life shortening behaviors by living God’s way which GENERALLY lead to longer life.
For example, the overarching command to love our neighbor as ourselves, means the obedient will not engage in behaviors that abuse themselves or others, which lead to incarceration, or vengeance, addiction, violence, or other bodily harm. People in Christian medical sharing co-ops pay very reduced monthly premiums. Why? Because the people in the pool covenant to not engage in behaviors prohibited in God’s Word, drunkenness, sexual promiscuity, addictive substances, gluttony. They all will (on average) live longer, therefore will pay less medical costs because of their obedient lifestyles.
Now, on the other hand, the Bible takes note of the times when the disobedient seem to live long and prosper. For example:
You will be righteous, Lord, even if I bring a case against You. Yet, I wish to contend with You: Why does the way of the wicked prosper? Why do the treacherous live at ease? 2 You planted them, and they have taken root. They have grown and produced fruit.Jer. 12:1-2
God is truly good to Israel, to those whose lives are pure. 2 But my feet had almost stumbled. They had almost slipped because I was envious of arrogant people when I saw the prosperity that wicked people enjoy. 4 They suffer no pain. Their bodies are healthy.Ps. 73:1-4
So there are times when those who are disobedient live long and prosper. It could be that part of their long life is due to the fact that they obey God’s design instructions in SOME areas, but they are disobedient in other areas. For example, they obey the Bible’s instructions that relate to physical health, but in their arrogance they are hard-hearted and greedy and cruel.
JP Getty lived a long time – 83 – but he was a man of 4 marriages, sexual immorality, acrimony and conflict in his home, estrangement from his children and a tight-fisted, angry man who once refused the ransom demand for his own kidnapped grandson. The Bible acknowledges these examples when disobedience DOES NOT correlate to shorter life.
Then, on the opposite side of this, sometimes, the obedient live very short lives. Very recently, a wonderful man, Nabeel Quarishi, a gifted Christian speaker, a medical doctor, a defender of the Christian faith, died. Stage 4 stomach cancer found last year. And he was 34, leaving a young wife and a little daughter behind. Why? It cannot be because he was flagrantly disobeying God or his good instructions for life.
We don’t always know why obedience isn’t ALWAYS connected to long life, or disobedience to short life. But we know that God is generous with everyone, the righteous and the unrighteous. Jesus said, in Matt 5:45-46: “God causes His sun to rise on the evil and the good, and sends rain on the righteous and the unrighteous.” It’s God’s grace to all of us that we live even for the next moment, and the next. God doesn’t owe us a single moment, all of life is a gift.
So with a kind of child-like trust, we entrust to God those situations which do not match, when bad behavior does not correlate to shorter life, or vice versa. And we can be happy that God is gracious to us all, that in some sense, as measured by the spiritual demands of God’s holiness, NONE of us is obedient.
And so every breath, every moment we live, no matter how long or short, we are living on grace. None of us has EARNED a long life. It may be we have done things that on average will lead to a long life, and God’s commands and promises should be seen as blessing us that way. And disobedience can have many natural consequences, some of which are to curtail physical health and longevity.
But the most important thing is that as long as we live, we remember God blessed all us disobedient ones by sending his own Son to extend our lives indefinitely! I quote the Apostle Paul at length:
We can understand someone dying for a person worth dying for, and we can understand how someone good and noble could inspire us to selfless sacrifice. 8 But God put his love on the line for us by offering his Son in sacrificial death while we were of no use whatever to him. 9 Now that we are set right with God by means of this sacrificial death, the consummate blood sacrifice, there is no longer a question of being at odds with God in any way. 10 If, when we were at our worst, we were put on friendly terms with God by the sacrificial death of his Son, now that we’re at our best, just think of how our lives will expand and deepen by means of his resurrection life! THE MESSAGERom 5:7-10
So the most important thing is that every moment we live we are able to call God our Father, Abba, whether sick or well, old or young, well fed or hungry. One day, long or short, this life will end. Then what? For us in Christ, made new by his forgiving love, true Living only then begins.