Let's start from the beginning...
Barrel length and gas system are independent from the buffer system and type of stock. Therefore, there is no definitive answer for your question.
There are 3 basic buffer systems out there; Rifle, Carbine, and Vltor A5. There are a few other exotics, but let's stick with these for now.
The type of buffer system you need is primarily defined by the type of stock you intend to use.
Are you planning on running a fixed stock, such as an A1, A2, Magpul PRS, or Magpul MOE fixed rifle stock? If so, then you will need a rifle length buffer tube, spring, and buffer.
Are you planning on using an adjustable stock, such as an M4 stock; Magpul MOE, CTS, STR, SL, ACS, or ACS-L; B5 Bravo or SOPMOD; Vltor EMod or IMod; etc...? For these, you will need a carbine length buffer tube, spring, and buffer. There are plenty of options to choose from, and almost all use the same 6-position carbine buffer tube (receiver extension). There is also a Magpul fixed carbine stock that uses a standard carbine buffer tube.
The Vltor A5 system is more of a hybrid carbine buffer system. It uses a special buffer tube that is 3/4" longer than the standard carbine buffer tube, and has 7 positions instead of 6. The added length works well with the Vltor EMod and Magpul ACS/ACS-L stocks. It also uses a special 4" long heavy buffer, and a rifle buffer spring. Again, it's a hybrid system that only works with specific components. The Magpul UBR Gen. 2 stock is also compatible with the Vltor A5 heavy buffer, but uses it's own proprietary receiver extension.
There are a few other exotic options to choose from, but this covers the 3 basic categories.
Separate from the choice of buffer system and stock is the issue of buffer weight. I'd recommend starting with the standard buffer weight and spring for whichever stock you choose, and then start looking into heavy buffers like an H2 or H3 buffer only if needed. There are also lots of different spring choices on the market, but again, just start with the basic version and go from there.
I know that it seems overwhelming due to the incredible number of choices and options available, but it really boils down to the three categories mentioned above. You just need to decide if you want a fixed stock or an adjustable stock, and go from there.
I hope this helps!