When you take your pregnancy test, just after you missed your period, you will normally be at around two weeks after ovulation, and a bit less time will have passed since your partner's sperm met your egg, and new life was created. Yet, most doctors will say that you are already "four weeks pregnant" at this point, even if you know exactly when you conceived, because you were charting to conceive, or using an ovulation calendar. That is because the method in which your due date is generally calculated is based on your last menstrual period, also commonly referred to simply as "LMP". From your healthcare provider's point of view, your pregnancy officially started on the day of your last menstrual period.
They use this as a reference point for several reasons. First of all, not everyone knows the exact date of their conception, and secondly, not everybody ovulates at the same time in their cycle. Most women who are trying to conceive do know the date their last menstrual period started, though. Your baby's estimated due date (EDD) will be given by your healthcare provider (or even by free online due date calculators, if you want to have a go!) based on your LMP. According to the LMP method of calculating due dates, the average baby remains in its mother's uterus for 266 days. So your doctor or midwife will take those 266 days, and add 14 days to allow for the half of your cycle before you most likely conceived.
Most babies are not born exactly on their due date. You will be at "term" from 38 weeks gestation, and your baby is expected to arrive anywhere between 38 and 40 weeks. If you go into labor before 38 weeks, that will be considered preterm labor. Your baby might need additional care, and a stay in the NICU. If you have not gone into labor by 40 weeks, your typical healthcare provider will consider you "overdue" and might start discussing induction with you.