The context obviously addresses children and parents. Paul makes it clear that children have a responsibility before God and that keeping the commandment has definite benefits for them to anticipate receiving. This is in agreement with Deuteronomy 4:39-40.
One of the benefits he mentions is the prospect of long life, which also contains an implication of prosperity. Not the least of the additional benefits is the gradual development of understanding and wisdom garnered from the parents, which themselves help to produce long life and prosperity. Thus, in an overall sense, he is reminding children that obedience to truth has its rewards.
Is there an age at which or a circumstance under which the child's responsibility to honor his parents undergoes a change? The answer is both "Yes" and "No," which is why Paul qualifies his charge to children. His qualification is contained within the phrase "in the Lord." It connotes what is within the boundaries of the Lord's way. In all cases, the responsibility to honor one's parents diminishes when a child marries, and his first attention must be given to the spouse. Cleaving to the spouse trumps the honoring of parents. Paul qualifies this a step further by implying that, if the parents demand submission beyond the bounds of Christian conduct, that is, not "in the Lord"—such as commanding a child to give up the Sabbath, lie in their behalf, steal for them, or bow down to an idol—in such cases the child's choice should be to submit to Christ rather than to his parents. Submitting to God's commands trumps submitting to parent's commands that are beyond what God commands us to do in order to stay "in the Lord."