In America, if you ask someone what a fort is, chances are he will tell you, "Well, it's an enclosure made of wood that affords some measure of protection against enemies, as in the 19th century when American soldiers and settlers gathered inside the fort to protect themselves from attacks by Native Americans ("Indians").
Fort comes from the Latin word fortis, meaning strong. A fortification is a strong structure that protects. It need not be made of wood, but it could be made of metal, brick, concrete, rocks, boulders, timbers, or a combination of some or all of these. It is a generic term for a protective structure of some sort.
A fortress is a protective structure, but it has the connotation of being massive, imposing, exceedingly strong, and difficult to penetrate. Martin Luther's most famous hymn is "A Mighty Fortress Is Our God, A Bulwark Never Failing."
A stronghold also affords protection from enemies, but the word is used more commonly to denote a temporary protective measure. A stronghold is, by connotation, not as impenetrable as a fortress but can be abandoned, if necessary, when it becomes compromised. Interestingly, some bad habits and addictions can be described as strongholds in people's lives, but these strongholds can be brought down and defeated through diligent effort and through the support of a network of helpers, particularly recovering addicts who hold the addict accountable for his recovery.
A citadel is also a fortress, but it is designed to protect the residents of a city from besiegement by an enemy force. It could take the form of a thick wall that surrounds the center of the city, with such features as a bastion, a rampart, ravelin, glacis, and more.
For a great diagram of a castle, see http://www.allcrusades.com/CASTLES/GLOSSARY_OF_CASTLE_TERMS/glossary_of_castle_terms.html
A castle is a permanent fortification and is thought of, traditionally, as the residence of royalty--a king and/or a queen. Soldiers and guards inside the castle serve the royal family by providing protection from attack. A host of employees and/or servants work and perhaps live within the castle's walls, and serve as tradesmen, cooks, bakers, scullery maids, groomsmen, merchants, clergymen, and other service providers.
Some castles have a moat, which is deep, wide trench, usually filled with water, surrounding the rampart of the castle; a drawbridge that links the castle to the barbican by spanning the moat in the down position to allow people in and out, and preventing entry to the castle when in the up position; a chapel for religious rituals; a dungeon (or dunjon), the heavily fortified central tower or keep, which serves as a fortification and possibly as a jail for criminals.
Finally, a palace is also the residence of royalty, and in addition to being constructed so as to offer protection to the royalty and citizenry inside, a palace's architecture is more elaborate and aesthetically appealing than that of a castle, which while attractive in its own right is designed primarily with protection, not beauty, in mind.
When people think of a palace, they might automatically think of the Palace at Versailles in France, which was built in the 17th century for Louis XIV in the southwest section of Paris (near Versailles). This palace, like many others in Europe, comprised elegant rooms and halls, decorated and furnished extravagantly with chandeliers, intricate woodwork, rare art (e.g., paintings, tapestries, sculptures, statues), and every conceivable creature comfort for the royal family, who was attended to by courtiers and servants galore.