No specific time
The physical pain from a stillbirth
normally lasts only a few days to weeks after delivery, so i assume you mean the grieving.
Everyone mourns differently but many women won't really feel ok until they have successfully delivered a healthy baby. There is no need to wait more than 3 months to try to get pregnant again unless you have other health concerns.