How long does $5 soldering irons(that plug directly into mains) last?

As some have alluded to the weakest point are the tips. Once whatever plating on the tips burns off the tip is useless because the solder will not "wet" on the tip. It will be like trying to get water to wet an oily surface.

Once this happens it will be difficult if not impossible for the iron to heat the pin and board to solder it. this is because the heat to the to be soldered joint travels through the solder blob on the tip.

My suggestion is to purchase one (try to stay near 40W and not 60W) and give it a try.
I would suggest you don't leave the iron on when not using it, to keep the tip from overheating. And periodically melt some solder on the tip to keep it tinned.

When soldering a through hole part, you get a small blob of solder on the tip, contact both the pin and board with the tip and the blob of solder, feed in some solder and about 3 seconds later you will be done. There are many tutorials on this topic.

Also, you should get the right type of solder. Try 63/37 solder with flux (no clean is you can). The solder should be about 0.030" to 0.05" inch in diameter. Having the right solder will go a long way to making good joints.