The Last Starfighter (1984) is a feature length theatrical release that fits the main plot elements you have outlined here.
Main protagonist is named Alex Rogan, who's kind of an average teenager, who does maintenance at a trailer park and is the best at the video game Starfighter.
Unknown to Alex, the video game is actually a test, and the conditions in the game with the war against "Xur and the Ko-Dan armada" are real.
After much teen angst, Alex Gets his act together and saves Rylos, and is proclaimed a hero by the people.
He returns to Earth to get his girlfriend and then leaves to train a new generation of Starfighters.
scifi.stackexchange.com/users/12305/JohnP
You might be thinking of the first episode of Stargate Universe, where character Eli Wallace is playing a game called Prometheus.
Being the first and only person to win the game solve a top secret weapon puzzle placed in the game results in the military general in charge of the Stargate program showing up at his door...
scifi.stackexchange.com/users/487/Tanath
My guess is Warriors of Kudlak from series 1 of The Sarah Jane Adventures .
It's about a laser-tag game where the children who are best at it disappear without a trace.
And as it turns out, they are being recruited by aliens.
scifi.stackexchange.com/users/4495/Mr Lister
While not technically a "computer game" in the strictest sense, this also reminds me of Photon , which was based on the laser-tag style game/set of toys.
Per Wikipedia: Photon followed the adventures of a young high school student, Christopher Jarvis with the alias of "Bhodi Li".
Chris discovers that the lasertag game Photon is actually a way to detect the strongest warriors in the galaxy, who will then be recruited to fight the forces of darkness.
After shooting his laser gun and saying "The light shines!
", he would be transported to a space station to join his fellow Photon Warriors.
His alien compatriots include an orphan earthling boy genius named Parcival, a shape-changing blob named Pike, a lizardoid named Leon, a cyborg named Lord Baethan, and Tivia, a black ninja princess from Nivia populated by women after the males became extinct.
Their mentor is a sentient computer named MOM (Multiple Operation Matrix).
The villains' motto is "Let the darkness grow!"
scifi.stackexchange.com/users/5184/phantom42
The Demon Headmaster series (first broadcast on the BBC in 1996) featured a plot a little like this, although it was a girl, Dinah, who was good at the game.
scifi.stackexchange.com/users/440/Paul D. Waite
I think you're searching for Aaron Stone.
He also needs to fight mainly the villains that are included in the video game, and he also gets a Robot to live with him as a sort of handler/watcher.
http://www.tv.com/shows/aaron-stone/
scifi.stackexchange.com/users/56186/user56186
It was about this boy who was the best player of a computer game in the world, and gets recruited by this organisation by using the same weapons in the game.  It was a drama played by actors, not a cartoon. Anyone know the title of it?
What children's TV show had a boy recruited by an organisation because he was the best at a computer game?
scifi.stackexchange.com
<story-identification><tv>
scifi.stackexchange.com/questions/41512
scifi.stackexchange.com/users/17922/daisuke miyahira
Suggestions for films and TV shows with such a premise include "The Last Starfighter"(1984); "Stargate Universe", where character Eli Wallace is playing a game called Prometheus; "Warriors of Kudlak" from series 1 of  The Sarah Jane Adventures; "Photon"; or "Aaron Stone". The title of this may be one of: The Last Starfighter; Stargate Universe; Warriors of Kudlak; Photon; or Aaron Stone.
The title of this may be one of: The Last Starfighter; Stargate Universe; Warriors of Kudlak; Photon; or Aaron Stone.