Could be quite a while, depending upon soil type, water table etc.
A couple of years ago I dug up a cat in our veg plot, which must have been buried by the previous inhabitants. Therefore must have been at least 7 years old, but still had much fur & flesh (didn't smell very nice though). This was in dry, sandy soil -- might last much longer in waterlogged soil.
In a compost heap or similar it would disappear to bones in a year or so. But if flies have laid eggs before burial, the maggots would eat most of the flesh in a few weeks.
Lots of research is done on human corpse decomposition, to help aging murder victims etc. For example, at the "body farm" in the US they stake out donated human bodies in various situations and record the results...