In that generality, there cannot be such an extension theorem. Let $X = \{ z\in\mathbb{C} : \lvert z\rvert \leqslant 1\}$, and $A = Y = \{ z \in \mathbb{C} : \lvert z\rvert = 1\}$. The identity $f$ of $Y$ has no continuous extension to $X$.
$Y$ must have some additional topological properties to allow such extensions. Since every compact space is completely regular, $Y$ can be embedded into a product of unit intervals, $\iota\colon Y \hookrightarrow I^T$, and Tietze's theorem guarantees that $\iota\circ f$ can be extended to $\widehat{F} \colon X \to I^T$. If $Y$ is a retract of $I^T$, i.e. there is a continuous $\rho \colon I^T\to Y$ with $\rho\circ\iota = \operatorname{id}_Y$, then $F = \rho\circ \widehat{F}$ is a continuous extension of $f$. Conversely, $\iota(Y)$ is compact, hence closed in $I^T$, and if $Y$ has the extension property, then $\iota^{-1}\colon \iota(Y) \to Y$ has a continuous extension to $I^T$, and thus $Y$ is a retract of $I^T$.
So a compact space $Y$ has the extension property if and only if it is a retract of some $I^T$.