They used hydrostatic (Water Pressure) fuzing. For aircraft depth charges, the initiation depth was set to 35 feet.
For most of the war, submarines were detected by aircraft while they were surfaced. The aircraft was usually detected when it was about 60 seconds out. If the submarine was rigged for a Crash Dive, the time from initiating the dive to the conning tower submerging was 30-40 seconds. After another 30 seconds, the submarine would be too deep to be damaged by the depth charge (Lethal radius about 25') release interval in an attack was about 60 feet between releases. The bomb would sink for about 2-3 seconds before the fuze initiated.
If the submarine hull or conning tower were above the surface at release time, the aimpoint for the middle of the stick was the conning tower or somewhat forward. If the sub was submerged for less than 30 seconds, lead was estimated from the location of the "swirl" left by the submerging sub, and an assumed speed of the target of about 5 kts.
Drop altitudes were generally below 100'.