In a Hausdorff space, every compact set is closed (How to prove that a compact set in a Hausdorff topological space is closed?).
This establishes the direction "$\Rightarrow$", because $A\cap K$ is then closed as an intersection of closed sets.
In the other direction, let $x \in \overline{A}$ be arbitrary. Then there is a neighbourhood $U \subset X$ of $x$ such that $\overline{U}$ is compact (because $U \subset K$ for some compact (hence closed) set $K$, so that $\overline{U} \subset K$ is compact as a closed subset of a compact set (Closed subsets of compact sets are compact).
But then $A \cap \overline{U}$ is closed and $x \in \overline{A \cap \overline{U}}$, because for each neighbourhood $V$ of $x$, we have
$$
A \cap \overline{U} \cap V \supset A \cap (U \cap V) \neq \emptyset,
$$
because $U\cap V$ is a neighbourhood of $x$ and $x \in \overline{A}$.
Thus, $x \in \overline{A \cap \overline{U}} = A \cap \overline{U} \subset A$, i.e. $\overline{A} \subset A$, so that $A$ is closed.