Just as Sarpedon mentioned there are two basic types.
1. Mines: a) contact mine (which would explode when a ship touches them. b) magnetic mines (dropped in shallow waters or rivers—they will be attracted by the metallic hull of a vessel going close by, rise, make contact and explode, or explode in the mud, without contact, and the shock breaks the ship’s back), c) time mines--dropped usually by aircraft into an enemy harbor and preset to explode at a certain time, d) remote detonated mines—same as time mine but set to explode when an operator presses the button, e) acoustic mines—made to explode by the engines signature of a capital ship.
2. Depth charges: a) clusters (small bomblets designed not necessarily to destroy a sub but more to scare it away—they are designed to explode at a preset depth or on contact), b) drums (large charges dropped by surface vessels or aircraft, meant to create a shock wave and rupture a sub’s hull—different sizes, power and depth). c) acoustic charges (exploded by the noise generated by a sub’s propellers).
3. Torpedoes (can be launched by a sub, ship, chopper or aircraft): a) the old contact type (currently phased out), b) acoustic or echo (homing on the noise signature of a ship or sub, c) magnetic (same as mines), d) wire guided (where a wire is used to control, direct and explode it), e) nuclear (no longer contact but proximity fused).
These days, guided missiles are the new trend. Some missiles can carry attack torpedoes, greatly increasing their range.