We don't know
Tolkien doesn't address this, so one can only guess what happened to the Nine Rings. Here are some very likely possibilities of what happened to the Nine Rings.
Possibility 1
- The Nazgûl had kept their Rings with them, prior to both of Sauron's defeats in the Second Age
It is possible that the Nazgûl had kept their Rings with them throughout the Second Age when Sauron was defeated by Ar-Pharazôn and Isildur. Hence, this would explain why the Rings were never lost.
2251 Tar-Atanamir takes the sceptre. Rebellion and division of the Númenóreans begins. About this time the Nazgûl, or Ringwraiths, slaves of the Nine Rings, first appear.
In the year 2251 of the Second Age, the Nine Men who are given the Nine Rings become invisible and known as the Nazgûl. They had to have their Rings on them in order for them to 'transform'. As Gandalf notes:
'And if he often uses to Ring to make himself invisible, he fades: he becomes in the end invisible permanently, and walks in the twilight under the eye of the dark power that rules the Rings.
It is a speculation, but one could say that the Nazgûl had kept their Rings with them after Sauron's two defeats, and Sauron took the Rings back only at a later date.
Possibility 2
- Sauron had brought the Nine Rings to Númenór upon his 'capture'
Another theory would be that upon his surrender to the Númenóreans, Sauron went back to Númenór with them and brought both the One Ring and the Nine Rings to Númenór with him. By this time (3262) the Nine Men would have transformed into the Nazgûl (2251), so Sauron could have taken the Rings from the Nazgûl already.
It is of course, proven that Sauron took the One Ring to Númenór with him.
Ar-Pharazôn, as is told in the 'Downfall' or Akallabêth, conquered a terrified Sauron's subjects, not Sauron. Sauron's personal 'surrender' was voluntary and cunning : he got free transport to Númenór! He naturally had the One Ring, and so very soon dominated the minds and wills of most of the Númenóreans.
The Letters of J.R.R. Tolkien - Letter 211
This would contradict my first possibility, but it is also likely. Sauron took the Nine Rings, along with the One Ring, with him to Númenór when he was taken as a 'prisoner'.
Overall, the first possibility seems the most likely. Why?
When Isildur vanquished Sauron at the end of the Second Age, the Nine Rings were not found upon Sauron- or Isildur would have took them as well. The only explanation for this would be that the Nazgûl had the Nine Rings in their keeping the whole time. It is likely that Sauron took the Nine Rings back from the Nazgûl upon his re-emergence in the Third Age.
We do know that the Nazgûl went into hiding upon Sauron's defeat, so it can be that they took their Rings into hiding with them.
3441 Sauron overthrown by Elendil and Gil-galad, who perish. Isildur takes the One Ring. Sauron passes away and the Ringwraiths go into the shadows. The Second Age ends.