What is the shelf life of homemade compote?
If you placed it in a sterilised jar (boiled for ten minutes, compote added, jar sealed, then boiled for another ten minutes), and assuming it had a decent amount of sugar, it should last weeks even outside of the fridge, especially of unopened. This is standard practice for making homemade jams.

Once opened, it should be kept in the fridge to inhibit mould growth. It should still last a couple of weeks.

If you didn't do all this, I would think it would last a week or two, but there's really too many factors to give an accurate answer. You'll just have to judge its look, smell and taste.