Caffeine crosses the placenta, and high intakes have been linked with low birth weight and other concerns, so pregnancy guidance recommends keeping intake modest rather than eliminating it entirely for most people. Authorities commonly advise staying under a limited daily amount, but exact figures vary by region, so check local guidance.
Remember caffeine is not only in coffee. Tea, cola, energy drinks, chocolate, and some over-the-counter medicines contain it too, and amounts vary a lot between products and serving sizes.
If you find it hard to cut down, reduce gradually to avoid headaches, and consider decaffeinated options. If you have pregnancy complications or your doctor has advised a stricter limit, follow that advice. Energy drinks in particular are best avoided.