To add to the above,
In the case of telescoping receiver extensions, on the cheap ones it's not uncommon to have to shorted the end of the tube to get it to almost kiss the center post, and index correctly for the butt stock. When doing this, make sure not only to shorten the bottom of the tube, but the top as well so the top of the tube does not protrude out the front of the receiver threads (will block the upper from closing.
To note, in some causes, instead of the op shorting the entire end of the tube, then just notch out a small U (just larger that the center post) so not only is the back outer edge retained, but a bit of the outer edge sides as well.
In regards to a cheap fixed stock receiver extension, sometimes you have to set back the seating collar to get the needed almost kiss to the center post of the buffer retainer.
Bottom line as stated, then end of the receiver extension on the outer section of the buffer retainer is what holds it in place.
P.S. When pulling the tube, don't loose the rear take down spring and detent that is held in place by either the end cap for a carbine stock, or the stock itself on a fixed stock.