The nail bed takes between 7 to 10 days to heal after you lose your nail.
Then after the nail bed heals within 7 to 10 days it can take up to 4 to 6 months for a new nail to grow in the place of the old one once the nail bed heals.
Most times a nail bed will heal on it's own at home but some more severe injuries to the nail bed can require surgery to fix the nail bed.
To prevent infection and promote the healing of the nail bed, Soak your foot or hand in a solution of 1 tsp (5 g) of salt dissolved in 4 cups (1 L) warm water for 20 minutes, 2 or 3 times each day, for the next 3 days.
Be sure to keep the nail bed dry, clean, and covered with petroleum jelly and an adhesive bandage until the nail bed is firm or the nail has grown back.