The time it takes for compost to mature varies. It's partially determined by climate. Warm temperatures increase microbial activity and speed up the decomposition process. Cool temperatures slow things down. The types of materials you use and the amount of attention you give your pile to ensure it has enough air and moisture also affect timing. Your compost might be ready to use in three months or it could take more than a year before it's fully mature.
Your finished compost will have no resemblance to the materials you tossed in the pile. If it looks dark and crumbly, it might be ready to use. But you'll want to make sure. An immature mixture that still contains food scraps could attract rodents or other vermin.
A simple bag test will indicate when your compost is ready. Put a handful of the compost into a ziplock bag and leave it sealed for a week or so. When you open the bag, it should have a pleasant, earthy smell to it. If it has a sour odor or has an ammonia smell, the microorganisms are still at work. It's best to give it another week to finish curing. After a week, test it again.