For Hausdorff spaces your statement is true, since compact sets in a Hausdorff space must be closed and a closed subset of a compact set is compact. In fact, in this case, the intersection of any family of compact sets is compact (by the same argument). However, in general it is false.
Take $\mathbb{N}$ with the discrete topology and add in two more points $x_1$ and $x_2$. Declare that the only open sets containing $x_i$ to be $\{x_i\}\cup \mathbb{N}$ and $\{x_1 , x_2\}\cup \mathbb{N}$. (If you can't see it immediately, check this gives a topology on $\{x_1 , x_2\}\cup \mathbb{N}$).
Now $\{x_i\}\cup \mathbb{N}$ is compact for $i=1,2$, since any open cover must contain $\{x_i\}\cup \mathbb{N}$ (it is the only open set containing $x_i$). However, their intersection, $\mathbb{N}$, is infinite and discrete, so definitely not compact.