Nothing is drunk until it happens. Drinks arrive, everyone waits, someone says a line and then 乾杯, and only then does anyone lift a glass to their mouth. Starting early is the one real mistake available here, and it is a visible one. If your drink arrives first, you wait.
The literal meaning is a fossil. 乾 dry, 杯 cup — drain the cup, as in Chinese gānbēi, where it can still be meant. In Japanese it long ago stopped being an instruction. Draining a glass in one is 一気, it is a different act, and it is discouraged for good reasons.
Hold your glass lower than a senior person's. When glasses meet, the more junior rim goes below. It is not enforced like a rule of grammar, but it is noticed and it is easy — and the same instinct governs who pours for whom, which is the other half of drinking etiquette.
It is not a thank-you and not a greeting. English cheers does several jobs; 乾杯 does exactly one. At a work meal the thanks are お疲れ様です, which may come around the same moment and is a different sentence doing different work.