The amount of time that you leave fondant in a mold will depend on several factors, including the size and shape of the mold, the humidity and temperature of the environment, and the type of fondant you are using.
As a general rule, fondant should be left in the mold for long enough to set and harden, but not so long that it dries out and cracks. This typically takes anywhere from 10-30 minutes, but it may take longer if the fondant is very thick or if the mold has intricate details.
To determine if your fondant is ready to be removed from the mold, gently press on it with your fingertip. If the fondant feels firm and holds its shape, it is likely ready to be removed. If the fondant is still soft and pliable, it may need more time in the mold.
Once you remove the fondant from the mold, you can let it dry completely before using it to decorate your cake or other baked goods.