When is composition in $A$-mod surjective? Let $k$ be any field.  Suppose that $A$ is a finite dimensional associative $k$-algebra.  Let $A$-mod be the category of finite dimensional (over $k$) left $A$-modules.  Then composition of homomorphisms induces a linear map:
$$
Hom_A(X,A)\otimes_k Hom_A(A,Y) \longrightarrow Hom_A(X,Y).
$$
If $A=k$, then this map is an isomorphism.  For arbitrary $A$, is this map surjective for all $X,Y\in A$-mod?
If not, then for which algebras $A$ will this map be surjective?

This property does not hold in general.  In fact, it holds if and only if $A$ is semisimple.
Using your notation, the image of the composition map is the set of morphisms $f:X\to Y$ that factor through a free module.  Indeed, the image of a sum $\sum_{i=1}^n g_i\otimes h_i$ is exactly the composition of the morphism
$$ \pmatrix{g_1 \\ \vdots \\ g_n}: X\to A^n $$
with the morphism
$$ \pmatrix{h_1 \ldots h_n}:A^n\to Y.$$
Thus the composition map is surjective if and only if every morphism between any two modules $X$ and $Y$ factors through a free module.
If $A$ is semisimple, then any module $X$ is a direct factor of a free module, so any morphism from $X$ to $Y$ factors through a free module.  Hence the composition map is surjective.
Now, if the composition map is surjective, then the identity morphism $X\to X$ factors through a free module.  This means that $X$ is a direct factor of a free module.  Since this is true for any module $X$, we get that all $A$-modules are projective, and this implies that $A$ is semisimple.
