The standard advice is to wait six weeks. That number marks the point at which tissue has largely healed — it does not mean everyone is ready on that day, nor that not being ready is a problem.
What commonly happens early on, and is normal: dryness, driven by low oestrogen and particularly pronounced while breastfeeding; altered sensation; anxiety and exhaustion, which affect desire far more than most people acknowledge; and some discomfort the first few times.
What helps: a water- or silicone-based lubricant, which is not an admission of anything but a direct fix for a physiological change. Going slowly. Talking to your partner rather than enduring in silence. And pelvic floor work that includes learning to relax the muscle, not only to contract it — a tight pelvic floor causes as much pain as a weak one.
When to see a doctor: pain every time that has not improved by three months; pain at one specific point, which often indicates a perineal scar that healed poorly; bleeding after sex; or muscles tightening so much that penetration is not possible. Each of these is treatable, and none is something you are expected to live with indefinitely.