In the original script, they found out almost immediately after landing.
RIC OLIE : We're all accounted for. Who flew that ship?
ANAKIN sheepishly opens the cockpit and stands up. All the PILOTS stare in
ANAKIN : I'm not going to get into trouble, am I?
The adult novelisation indicates that Obi-Wan found out shortly after that and considered it a sign that Anakin was the Chosen One the prophecies were talking about.
But it was a nine-year-old boy who had saved them all. Even without
knowing exactly what he was doing, Anakin Skywalker had flown a
starfighter into the teeth of the Federation defense, penetrated their
shields, landed in the belly of the Neimoidian flagship, torpedoed the
ship’s reactor, and set off a chain reaction of explosions that
destroyed the control station. It was the destruction of the central
transmitter that had caused the droid army to freeze in place, their
communications effectively short-circuited. Anakin claimed not to have
attacked with any sort of plan in mind or fired his starfighter’s
torpedoes with any expectation of hitting the reactor. But after
hearing the boy’s tale and questioning him thoroughly, Obi-Wan
believed Anakin was guided by something more than the thinking of
ordinary men. That extraordinarily high midi-chlorian count gave the
boy a connection to the Force that even Jedi Masters on the order of
Yoda might never achieve. Qui-Gon, he now believed, had been right.
Anakin Skywalker was the chosen one.