There are few items more foundational to camping or backpacking than a sleeping bag. And contrary to what I expected, it's not entirely realistic to just order a bag and get something that works for you.
Sleeping bags are unlike clothing or tents or backpacks where fit mostly affects comfort; with a sleeping bag fit can easily affect function. Too big of a bag, resulting in too much dead space, can reduce the warmth of your bag. Go too far to the other extreme with too snug of a bag and you'll compress the insulation and get cold spots. Trying on sleeping bags is as close to playing Goldilocks that most people will ever get.
If you're doing online research you will find it is easy to filter bags by length. Six feet tall or less, you'll do with a standard bag. Six-one to six-six, you'll want the long. See my Big Guy Gear Review for ideas. Over six-six, get a new hobby because you'll never find anything that fits.
Length isn't the only important measures shoulder girth and hip girth are also important measures that you'll probably have to determine on a bag-by-bag basis until retailers realize that's an important filter criteria. Too tight in the hips can make cold spots, same for shoulders--and tight shoulders can make ingress and egress difficult.
The style of bag will play a large part in how it fits. A mummy bag will be the snuggest and will restrict your movement the most, but will also generally be the lightest and smallest option. Don't be deterred by the name, they are actually quite comfortable. Semi-rectangular will give you the best of both worlds, with more space than a mummy and less bulk than a rectangular bag. The rectangular bag is probably what you envision when thinking of a sleeping bag. These are going to be the heaviest and bulkiest, but will give you room to sprawl. They will usually have a higher temperature rating than other bags, making them usable in fewer scenarios (but a bag liner can increase its range). The rectangular bag is less preferred for backpacking due to size and weight, but there's nothing inherently wrong with them so if that's all you have go for it.
Once you find a good fit, you stilll have to make sure you have a temperature rating appropriate for your use. REI has a great tutorial on temperature ratings and I won't attempt to out do them, but in case you don't click through I will say that you want a temperature rating below the coldest temperature you will experience. Remember that you will lose heat to the ground and because you compress the insulation you're laying on, so a sleeping pad will be important for warmth...and also what masochistic doesn't camp with a sleeping pad.
If you find that your bag isn't quite warm enough you can always buy an insulated bag liner. These can be synthetic or silk and are like a lightweight sheet cocoon that add up 10 or more degrees of insulation. Liners add versatility to bags, they can be just enough insulation on warm nights, and also add some ventilation between your skin and the bag material.
Of lesser overall importance are weight and volume. If you're going ultralight and can pay around $400+ for a bag to save a few ounces then you may care a lot about weight. But if you're an average backpacker then you'll probably be fine with any backpacking bag's weight. Similar for volume concerns--get a waterproof compression bag to save space and your bag's insulating ability...that will probably take care of most of your volume concerns, but bags can take up a lot of space inside a pack.
Do make sure to have a way to keep your bag dry, a heavy-duty trash bag will do in a pinch. Down loses its insulation when wet. Waterproofed down (known by various trademarks) and synthetics will retain some insulation ability, but sleeping in a wet bag sounds awful.
If you're buying a new bag I highly recommend trying on as many as possible. Lay in your normal sleeping position on a pad similar to what you use. Move around to see how that affects fit. Test the zipper--few things make me panic like being in a mummy bag that won't unzip easily. Most bags have side zippers, but some manufacturers are making chest-zip bags. I'm not really a fan because those are more difficult to make the bag into a blanket on warmer nights.
Make use of the Internet and read user and professional reviews. Many online retailers have gear specialists available by email. Or go crazy and interact with the humans at your local store. Still in doubt? Buy somewhere with a generous return policy so if you find fit problems you won't be stuck with a bag that's defective for your needs.
And once you have a bag make sure to care for it correctly. A properly cared-for down bag can last decades.