Is it Logan's Run (1976)? From Wikipedia's description (emphasis mine):
In the year 2274, the remnants of human civilization live in a sealed city contained beneath a cluster of geodesic domes, a utopia run by a computer that takes care of all aspects of life, including reproduction. The citizens live a hedonistic life but, to prevent overpopulation, everyone must undergo the rite of "Carrousel" when they reach the age of 30. There, they are killed under the guise of being "renewed.” To track this, each person is implanted at birth with a "life-clock" crystal in the palm of the hand that changes color as they get older and begins blinking as they approach their "Last Day.” Most residents accept this promise of rebirth, but those who do not and attempt to flee the city are known as "Runners.” An elite team of policemen known as "Sandmen,” outfitted in predominantly black uniforms and serving in an agency of the city called "Deep Sleep,” are assigned to pursue and terminate Runners as they try to escape.
The main characters, Logan 5 and Francis 7, are Sandmen. At the end of the film:
Logan, Jessica, and the other citizens flee the ruined city. Once outside, the citizens see the old man, the first human they have met who is older than thirty, proving that they can, indeed, live their lives much longer.
For the record, the search terms which led me to this film were dystopian film culling population officer city
. (Of course search results are different for everyone.) The top result was Wikipedia's list of dystopian films, which mentions this one, and the second result was the Wikipedia page for Logan's Run itself.