Making a legendary item would take way too long for this campaign. Is there any rule that states how crafting something like a Cloak of Invisibility could be pulled off by a player or NPC in a much shorter timeframe?
Yes, the rules as written provide some options. The 5e rules for crafting are explicit that they represent 8hrs of work per day by one crafter. The amount of time needed can be reduced by having additional people working, and/or working for longer. As one example, two elves (who only need to rest for four hours a day) could, with a DM's ruling, combine their efforts and craft for 2.5 shifts per day each, completing the item in 1/5th the time. Spells which allow the players to "recruit" other workers, like summon, conjure, or charm spells, would obviously also work here -- although it would again require the DM's ruling to allow this and to track "partial days" provided by spells with duration of less than 8 hours.
Further, the crafting rules do not involve ability checks of any sort, but the DM may choose to allow one to speed up the process. A very roughly analogious situation is detailed with the rules for Jumping:
When you make a high jump, you leap into the air a number of feet equal to 3 + your Strength modifier... In some circumstances, your GM might allow you to make a Strength (Athletics) check to jump higher than you normally can.
This is similar in the sense that the characters are ordinarily limited to a certain fixed value per attempt, but can exceed that with DM permission and an ability check. You could similarly allow proficient characters to make daily checks that reduce the number of "work days" still needed, perhaps with a penalty in wasted materials (that is, GP) for failure. (Haste makes waste.)
Finally, as the DM you are free to come up with alternative systems, with or without the "work days" constraint of the standard system. As an example, you could allow special materials to automatically count as a certain number of "work days," or allow a spellcaster to automatically reduce still-needed "work days" with specific spells you feel are appropriate (Mending and Fabricate have obvious applications, but spells like Produce Flame, Create Food and Water, and even Prestidigitation might represent ways of increasing efficiency.)