You either go to Minecon or you buy one from Optifine.net.
Chat with our AI personalities
Get a mod called Mccapes at mccapes.com and put the 2 .class files into the minecraft.jar then go back to mccapes.com and then find where is says enter username so enter your mc username and choose a cape and then click save option and log out go on minecraft and you should have a cape :) PS: for mac users i don't know how to do it for mac's so that's it.
you need to wear a differant skin the first skin pack with capes is the halloween limited edition but its not there anymore but the festive pack has skins with capes
One way to get the cape is to buy tickets to a Minecon. Each Minecon, a new cape is released and you must enter your username (I believe case sensitive!), and when you have bought the tickets, the cape will be given to your character. (Note: You do not have to fly/drive to Minecon once you have bought the tickets, although it is worth it!) Another way (which is the least likely, and most likely will not happen anymore), is if you do something for Notch. Notch will reward you with a cape. I am unsure of whether he still does this, however, you check out the capes in the related links below if you wish.
You could get it when buying a ticket to Minecon, but since Minecon is already over you can't get it anymore. Maybe they will give free capes with Minecon tickets again next year.
Cape but if a different answer you are looking for it is vest.