Why is cognitive maturity related to organism lifespan in larger animals and mammals?
This answer might not completely answer your question, since this just explains the case in humans, but I think you can give this a read while waiting for a more accurate one. I would recommend you to read this amazing paper.

Generally, across animal species, the longer it takes an organism to reach maturity, the longer it lives. How the timing of onset of maturity relates to longevity in humans, is still a matter of debate. In this regard, it is of special interest whether the onset of intellectual maturity is associated with longevity, as the brain and associated parts of the central nervous system comprise an organ system that is widely thought to have played a vital role in humans’ evolutionary success.

First, they talk about defining cognitive maturity:


  It would seem intuitive to define intellectual development as that part of the lifespan in which ability increases and intellectual maturity as that part in which ability plateaus or decreases. In such a model, an inflection point or peak in ability would mark the onset of intellectual maturity. It is unlikely, however, that the multidimensional abilities of composing and writing reach their peaks when a composer's or writer's work is made public for the first time. Rather, we regard maturity as a state that is attained when a certain relevant threshold is crossed, regardless of whether ability increases after that point.


Looking into the case of humans, it may be either a genetic mechanism or plasticity that couples rate of development and maintenance and repair. In the former scenario, genes that alter the rate of development such that maturity is reached earlier, would have as a concomitant effect the downregulation of maintenance and repair, leading to a shorter lifespan. (This is a shortened version- please go through the paper for more detail)

They conclude stating that the onset of intellectual maturity is associated with longevity. So, you are right about cognitive maturity of an organism being related to its age, and it points out to a really interesting result- blooming composers and writers live longer than child prodigies- as pointed out in a paper in ResearchGate.

What could be the reason for it? American psychologist Jerome Bruner proposed the purpose of the period of immaturity as being a time for experimental play without serious consequences, where a young animal can spend a great deal of time observing the actions of skilled others in coordination with oversight by and activity with its mother. So, there is the obvious need for a period of immaturity and this varies amongst different mammals. (source)