Most condoms are made from latex (rubber), a natural biodegradable substance, so they will break down in time – but that will take far too long for basic garden compost heap. The latex is often usually adulterated with synthetic materials too – either in the material or due to added lubricants etc – which might slow or impact its decomposition.
Non-latex condoms are typically made from polyurethane – a synthetic non-biodegradable plastic – so they won’t break down at all. Neither will the plastic & foil wrappers that condoms are sealed in prior to use – definitely leave those out of your compost heap too.
(As much as we hate sending things to landfill, the best way to dispose of condoms is simply wrap them in a little tissue paper/toilet roll and throw them in your regular rubbish bin. Flushing them is even worse than trying to compost them. It causes lots of problems in the sewerage process and can, in some circumstances, end up in the sea or rivers with other waste water. They also won’t break down as easily in water – there aren’t enough decomposition microbes around – so they’ll end up bobbing around for years.)