How long? $ for $ it's probably cheaper to purchase one, they carry them at the local Dollar Tree (dollar store) by me, 3 foot long or so for $1... The only drawback to the dollar store one I have used is that some USB devices complaint that it's not USB 2.0 compliant, others work fine...
But, there are others to be found all over Ebay if you want a pre-done one...
If you want to build your own, I would use CAT 5 or better network cable... As for the length you can go many feet, but the longer the run you will face potential communication issues... 16 feet is the max specified for USB 2.0, you can go longer but like the cheap USB cable I suggested above you might find performance dropping to USB 1.0 or it might not work at all... Another option if you want to go further is to simply get a USB to wireless network adapter, these can be had on Ebay for under $20 usually and work OK...