In fact, quite the opposite tends to be true. Mumford [1] showed that for $(X,0)$ the germ of a normal surface singularity (over $\mathbf{C}$), $U=X\setminus 0$, one has $\pi_1(U)=\{1\}$ if and only if $X$ is smooth. At the same time, $\pi_1(X) = \{1\}$ since $0\to X$ is a homotopy equivalence.

If $X$ is smooth, this is true (the etale variant is called "Zariski-Nagata purity").

**EDIT.** To address Francesco's comment: of course the example is not projective. The easiest projective example was given by Francesco in his comment: $X$ is the (projective) cone over an elliptic curve $E$ and $U$ the complement of the vertex. Then $\pi_1(U)= \pi_1(E) = \mathbb{Z}^2$ and $\pi_1(X) = \{1\}$.

[1] *Mumford, D.*, **The topology of normal singularities of an algebraic surface and a criterion for simplicity**, Publ. Math., Inst. Hautes Étud. Sci. 9, 5-22 (1961). ZBL0108.16801.