This can be purchase and they are made according to meters. Hence you might need to cable tie them if it's too long.
The advantage of doing it yourself is that you can alter then require length that you want and making cable management tidy.
Disadvantage is that if you decided to relocate your fan, you might not have the slack to extend them. Anyway here is a simple guide.
Remember to wear safety goggles and gloves when you are handling tools. It helps to prevent unnecessary injuries. If you are not confident or not adult enough to handle tools.
Kindly consult adults or experience tool user and please be really CAREFUL and ALERT
when you are doing this as you are dealing with electrical stuff. This involves a fair bit of risk on an untrained user especially when it comes to mod on electrical current.
I will not hold any responsibilities for any injuries or damage done.
The most important material you will need to make fan extension are 3pin fan header, 3pin molex fan holder and their pins.
As tools required, soldering iron & bits, a pair of scissors, a pair of long nose pliers, shrink wrap (your preference), rubber shrinks, lose wires, a lighter (or you can use hair dryer) and
unused striped audio cable (optional)
prepare the length of extension you need from the PSU connectors to your fan. remember to give some slack as in 3 to 4 cm more of the actual measurements.
You will need the extra length for the connectors.
Stripe both ends of the wires with a pair of scissors.
Clamp the bared wires to a mini bench vise. Tint both bared wires with a soldering iron and soldering bits. Once done, leave aside.
Plug the 3pin header to you working fan molex. using a marker, do some markings, as in positive + and negative -.
Trim the length of the tinted wires against the 3 pin header. See diagram above. Reason to do this is to strengthen the bond between the wire and the pin with rubber shrinks after soldering.
Place rubber shrinks on both tinted wires before soldering.