No. Take an elliptic curve $X$, and let $p \in X$ be a $3$-torsion point. Then there is a plane model of $X$ as a cubic curve in $\mathbb{P}^2(\mathbb{C})$, such that $p$ is an inflexion point. If $L$ is the corresponding inflexion line, then $U=X-L = X-\{p\}$ is dense in $X$ and affine (being the complement of a hyperplane section). Now $X$ and $U$ are not homeomorphic, for instance because their fundamental groups are not isomorphic; in fact $$\pi_1(X) = \mathbb{Z} \times \mathbb{Z}, \quad \pi_1(U) = \mathbb{Z} \ast \mathbb{Z}.$$