Home Depot and Lowe's have some (small selection) brass nipples, just for a starting point. They might have the length you need. To get something custom cut and threaded, go in person to a plumbing supply shop. If they can't do it for you on the spot, they will probably be able to refer you. Make sure to put on your best "I'm just a simple homeowner and need some help from the pros" look. Chances are they will take pity on you and help.
It's not difficult, but you need the right threading tools to do it cleanly. I did a summer job as a pipefitter and an electrician helper, wish I had all the tools I used back then.