The Dungeon Master's Guide lists "Crafting a Magic Item" as an option under "More Downtime Activities" (p. 128–129):
Magic items are the DM's purview, so you decide how they fall into the party's possession. As an option, you can allow player characters to craft magic items.
The creation of a magic item is a lengthy, expensive task. To start, a character must have a formula that describes the construction of the item. The character must also be a spellcaster with spell slots and must be able to cast any spells that the item can produce. Moreover, the character must meet a level minimum determined by the item's rarity, as shown in the Crafting Magic Items table.
The DMG then provides an example, and suggests that the DM may also require that certain items need special materials or locations in order to be made, such as alchemist's supplies to brew a certain potion.
The DMG continues:
An item has a creation cost specified in the Crafting Magic Items table (half that cost for a consumable, such as a potion or scroll). A character engaged in the crafting of a magic item makes progress in 25 gp increments, spending that amount for each day of work until the total cost is paid. The character is assumed to work for 8 hours each of those days. Thus, creating an uncommon magic item takes 20 days and 500 gp.
If a spell will be produced by the item being created, the creator must expend one spell slot of the spell's level for each day of the creation process. The spell's material components must also be at hand throughout the process.
(The halved cost for consumables is a correction stated in the DMG errata.)
The Crafting Magic Items table is as follows:
The potion of invisibility magic item has a rarity of "very rare", so the creation cost would be 25,000 gp (halved from 50,000 because it's a consumable) and the minimum level needed to craft it would be level 11.
Technically, the description of the potion of invisibility doesn't say it creates the effect of the invisibility spell, so any character of the relevant level could presumably craft one. (However, a DM could house-rule that it creates basically the same effect as the invisibility spell and has the same duration (without requiring concentration), and thus that it would also need to be crafted by someone who has a 3rd-level spell slot and knows the invisibility spell.)
Given that creation cost, it would take a single character of the requisite level 1,000 days to craft one potion of invisibility, spending 25,000 gp to do so.
Note that the DMG does include rules on assisting in making a magic item:
Multiple characters can combine their efforts to create a magic item if each of them meets the level prerequisite. Each character can contribute Spells, spell slots, and components, as long as everyone participates during the entire crafting process. Each character can contribute 25 gp worth of effort for each day spent helping to craft the item.
So, for instance, if the character is in a party with 3 others of 11th level or higher, they can help contribute to the cost in terms of time and money (and spell slots and components if relevant). With a wizard crafting the potion and 3 other characters assisting, the total creation cost (25,000 gp) would remain unchanged but the process would only take one-fourth as long: 250 days.