A common trope in sci-fi is the idea of humans reverse engineering alien technology which results in breakthroughs in our own technology. My question is this: If a military/governmental organisation were to reverse engineer a new technology from captured alien machinery, how long is it likely to be before that technology becomes available to the public?
The answer depends upon the strategic value of the technology against likely threats. Stargate-like arguments that "our society is not ready" are purely fictional (they add drama and conflict to the story), and are not a real consideration.
Strategic value: Nuclear weapons, radar, stealth, etc. These mitigated (even sometimes obsoleted) whole classes of then-existing weapon systems. They gave their owners a powerful --though often temporary-- strategic advantage in both warfare and international influence. Technology is generally kept secret for as long as it provides that advantage. Example: When everybody had access to radar, there was no point keeping it secret anymore.
Not all new-tech has strategic value: Zeppelins wound up having little strategic effect, and the marvel of encrypted-frequency-hopping radio has little offensive capability. The M16 assault rifle, while an incremental improvement, did not enhance anybody's international influence nor obsolete other types of hand weapons.
Likely threats: There are a whole spectrum of threats, from (fictional) super-powered Martian tripods with heat-rays to classic state-on-state military tank-and-helicopter-and-artillery to insurgents hiding among a population. Militaries pick the likeliest threats on the spectrum, and organize/equip/train to fight those. Against Martians, Bioweapons turn out to be very useful and it makes it makes sense to keep those secret. Against Independence-Day-type aliens, nuclear weapons are useless, so there's no point keeping them secret.
There's one additional point here - likely threats often include nutters or disenchanted small groups. Keeping truly nasty stuff out of their hands is generally in everybody's best interest. So materiel like fissiles and poisons are controlled, and some key technologies (like complex detonators) remain secret.
Of course, there is also bureaucratic inertia. Folks often don't notice when a secret is not worth keeping anymore, or folks who know the secret might be too close to the problem. In the USA, this is addressed by automatically declassifying after 25-years (with exceptions).
Because of conspiracy theories, in the United States there is a law automatically declassifying information over 25 years old, unless the classifying agency makes a case for extension. https://www.justice.gov/open/declassification/declassification-faq
If a classifying agency does make a case to keep information classified, they can do so in blocks of time no longer than 10 year extensions. The classified information must be re-reviewed at that time. Also, it is possible for a classifying agency to specify an event that will make the information declassified.
As Batman once asked Riddler: what riddle is not a riddle? The answer: The one that everyone know answer to.
Your secret is a secret as long as you no one know about it's existence, power, effect and ways of use.
For example you do reverse engineering on energy source and put it into tank. Then you deploy that tank and it get stolen. Now your enemy can do exactly the same thing - reverse engineering.
In history Japan pilot was unable to destroy his ZERO plane so it was seized by USA and used to make Mustang planes better.
But WD40, for example, have a secret inside "not a secret". The formula is not patented so they don't need to enclose the composition.
You may want, and be able, to keep a secret for decades because no one actually really cares. But you may want to release some technology because you may then use the privately build infrastructure for your needs. For example fiber optics or communication sattelites.