Indeed this space is 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).