Short answer: sealed, between roughly 15 and 20°C, dry, dark, and out of the fridge.
Temperature
Chocolate starts softening in the mid-twenties. A cupboard on an interior wall beats a shelf above the stove or a car glovebox every time.
Humidity
Moisture is the real enemy. Sugar bloom — a gritty white film — happens when damp air condenses on the surface and dissolves sugar that then recrystallises. Keep the packaging sealed and skip the bathroom cabinet.
Light
Direct sunlight both heats and degrades chocolate. Opaque packaging or a closed cupboard solves it.
Why not the fridge
Fridges are humid, and every time you take a bar out, condensation forms on the cold surface. Freezing is worse still. If a heat wave leaves you no choice, seal the bar in an airtight container and let it come back to room temperature before opening.
After opening
Reseal the wrapper or move the remainder to an airtight container. Chocolate readily absorbs strong smells, so keep it away from coffee, spices and onions.
How long it keeps
Follow the best-before date on the packaging. Stored properly, sealed bars comfortably reach it; stored badly, they bloom long before.
Ready for a fresh bar? See the mushroom chocolate collection.