Both 12-hour clocks and 24-hour clocks are used in most Spanish speaking countries. If we consider just Spain, 12-hour clocks are more common in conversations between people.The 24-hour clock format is used only in formal occasions, letters etc.
Puerto Rico, on the other hand, uses 12-hour format almost entirely and the 24-hour clock is rare in formal language. Overall, Spanish speaking countries use both.