With just the above parameters? No, the asteroid will never be captured.
An asteroid alone slinging by a planet will not be captured, because it needs to reduce its orbital energy relative to the planet and the Keplerian-Newtonian two-body interaction cannot do that without assistance; Orbital energy and orbital angular momentum are constants in Keplerian two-body interactions.
You need some sort of three-body interaction to happen for something slinging by the planet to get captured, such as:
A moon or other massive object already in orbit of the planet affecting the trajectory of the asteroid. This object can exchange angular momentum and orbital energy with the asteroid relative to the planet, allowing the asteroid to settle into an orbit around the planet, admittedly one that initially crosses the path of the existing moon.
Another object coming in with the asteroid, such as a massive binary companion, that can carry away the excess angular momentum and orbital energy out of the planet's region, leaving the asteroid in orbit around the planet.
The asteroid being torn apart by tidal interactions and interacting with its own pieces gravitationally so that some of the asteroid escapes, and some of it gets captured, as above.
Odd edge effects in the region where the gravity of the Sun the planet is orbiting around and the gravity of the planet are comparable.
None of these are simple calculations, and all of them require a lot more information than just mass of planet, initial asteroid velocity and distance, and minimal distance on the flyby.