No. This is not (completely) correct.
It depends on definition of compactness. Nowadays it is common to NOT include Hausdorff requirement in compactness (while it was so some years ago).
So, if you don't check that Y is Hausdorff, then the facts that Y is compact and that $Y\setminus \{a\}$ is homeomorphic to $X$, are not sufficient to conclude that $Y$ is the one point compactification of $X$ (the one-point compactification is unique in the realm of Hausdorff spaces, not in general).
Here an explicit example:
Let $X=\mathbb R$ with the usual topology (or any other space).
Let $Y=X\cup \{\infty\}$ with the following topology:
$A\subseteq Y$ is open if and only if it is either an open set of $X$ or if $A=Y$.
The space $Y$, with that topology, is compact. Indeed if $\{U_i\}$ is an open cover of $Y$, then there must be an open $U_{i_0}$ containing $\infty$, but the unique open set with that property is $Y$. So the sub-cover consisting of the sole $U_{i_0}$ is a finite sub-cover of $\{U_i\}$. Therefore any open cover has a finite sub cover and therefore $Y$ is compact.
Also, $Y\setminus\{\infty\}$ is clearly homeomorphic to $X$.
But $Y$ is not Hausdorff, so it is not the one-point compactification of $X=\mathbb R$ (which is $S^1$).