The quill stem relies on a wedge or 'quill' to tighten it in place. The fork steerer is threaded, and is usually cut flush with the top of the headset.
An ahead/threadless stem clamps to the fork steerer, usually using pinch bolts. The fork steerer is unthreaded, and extends up past the top of the headset to allow the stem to clamp to it.
You can only use a quill stem with a threaded headset, and you can only use an ahead stem with a threadless one
If you show me a picture of your bike and the forks you're using, I'll be able to tell you which headset/stem you'll need.
When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.