Best copper wire for solenoid
The limiting factor here will be the amount of current the 9V battery can source. This may be between 500mA and 1A, if you're using a typical alkaline type. (Energizer 9V datasheet)
Making electromagnets requires balancing voltage, current, wire gauge, and number of turns (total length of wire). For example, if you use a small length of reasonably large gauge wire (negligible resistance), the circuit will try to draw more current than the battery can supply, causing it to get hot and its lifetime severely shortened.
If you use a very fine gauge with many turns, there might be so little current that despite having many turns, the electromagnet is too weak for your application.
Start with the maximum current as a starting point. Since you are only engaging it for a few seconds, perhaps 500mA will work. If you use 32 AWG wire, which has a resistance of about 164Ω per ~300 meters, then you can determine the length of wire needed to draw that amount of current.
What resistance is needed for 500mA?
$$
R = E/I \\
R = 9V / 0.5A\\
R = 18Ω
$$
If 300 meters is 164Ω, then we can determine the fraction of that length that would be 18Ω:
$$
18 / 164 = 0.109\\
0.109 \times 300m = ~33m
$$
So you would need to wrap 33 meters of 32 AWG wire to have a resistance that draws 500mA.
But here is the complication: If you choose a thicker wire, the resistance will go down, making the current go up. But you'll also have a shorter wire, and fewer turns. So the goal is to optimize the number of ampere-turns: You want the highest current and a high number of turns.
Also of great importance here is the core diameter and material. The diameter will affect how many turns. My experience is that using a low carbon steel rod (more iron) -- something with high magnetic permeability -- will provide greater magnetic strength.
Because there are so many variables, I found utility in reading Rick Hoadley's Experiments with Electromagnets page. There is a link to a spreadsheet that allows you to enter core radius, wire gauge, coil length, and applied voltage to see the resulting number of turns, current, etc.
Although 9 volts can produce greater current with a given amount of resistance, a 9V battery can't provide as much current as 1.5V cells (AA, C, D), as Brian Drummond mentioned in comments. (This is because a 9V battery is made up of six quite small 1.5V cells that cannot source much current.)
Use the spreadsheet to experiment with different values for wire gauge and voltage. The gauss values will give you the resulting calculated field strength. To determine whether a given field strength is sufficient to lift the metal rod is beyond my knowledge; suffice to say, you might be building a few electromagnets before you succeed.