Indeed this space is (almost, see the comment by YCor) never compact except for trivial cases (i.e. the compact set $X$ having only finitely many points). For more information on the topology (which is colloquially known as the compact-open topology) of the space you are asking about, see e.g. the book Engelking: General topology. (Chapters 2.6 and 3.4 will have most of the information you could possibly need).
Thanks for the clarification by @YCor, the never compact of the original answer was a bit hasty and comes from my use of these spaces where $X$ is always locally euclidean (i.e. the $X$ should be a manifold). Which is of course not necessary.