If two space X and Y have isomorphic fundamental group then when can we say that this isomorphism is induced by some map f from X to Y? If two space X and Y have isomorphic fundamental group then when can we say that this isomorphism is induced by some map f from X to Y ?
and also what can we say about this question when we take higher homotopy group in place of fundamental group ?
 A: Not in general.
For example, let $X = \mathbb{R}P^n$ and $Y = \mathbb{R}P^m$ for $n > m$.  I claim that for any continuous map $f:X\rightarrow Y$, that $f$ induces the $0$ map on $\pi_1 = \mathbb{Z}/2\mathbb{Z}$.
To see this, assume $f$ is non-trivial on $\pi_1$.  Since $H_1$ is the abelianization of $\pi_1$, it follows that $f$ induces an isomorphism $H_1(X;\mathbb{Z}/2\mathbb{Z})\rightarrow H_1(Y;\mathbb{Z}/2\mathbb{Z})$.  Universal coefficients then implies that $f$ induces an isomorphism $H^1(Y;\mathbb{Z}/2\mathbb{Z})\rightarrow H^1(X;\mathbb{Z}/2\mathbb{Z})$.
Now, $H^\ast(X;\mathbb{Z}/2\mathbb{Z})\cong \mathbb{Z}/2\mathbb{Z}[x]/x^{n+1}$ and $H^\ast(Y;\mathbb{Z}/2\mathbb{Z})\cong \mathbb{Z}/2\mathbb{Z}[y]/y^{m+1}$ where both $x$ and $y$ are degree one elements.  By the previous paragraph, we have $f^\ast(y) = x$.
But then $$0  = f^\ast(y^{m+1}) = f^\ast(y)^{m+1} = x^{m+1} \neq 0 $$ because $m+1 < n+1$.  This contradiction implies $f$ must have induced the $0$ map on $\pi_1$.
One can use a similar argument with $\mathbb{C}P^n$ (respectively $\mathbb{H}P^n$) replacing $\mathbb{R}P^n$ in order to get an example using $\pi_2$ (respectively $\pi_4$).
A: This is not really an answer, but it's too long for a comment.  
I want to observe that while Jason has shown it is not in general true that every homomorphism of fundamental groups comes from a map of spaces, it is true for a particular class of spaces, namely Eilenberg-Mac Lane spaces.  That is,
$$[K(G,1), K(H,1)] \cong \operatorname{Hom}(G,H)].$$  So, if the two spaces in your question are Eilenberg-Mac Lane, then there is no problem to realizing the homomorphism of fundamental groups.  
Now suppose $X$ and $Y$ are arbitrary connected CW complexes.  By attaching cells to kill off higher homotopy groups, we obtain inclusions $X \to K(\pi_1 X,1)$ and $Y \to K(\pi_1 Y, 1)$ inducing isomorphisms on $\pi_1$.  We've already observed that we can fill in a map between $K(\pi_1 X, 1)$ and $K(\pi_1 Y, 1)$ realizing any desired homomorphism, so we have:
$$\begin{array}{ccc} X & & Y \\ \downarrow & & \downarrow \\ K(\pi_1 X, 1) & \rightarrow & K(\pi_1 Y, 1) \end{array}$$ We want to know whether the top edge can be filled in making the diagram commute.  
Up to homotopy, this can be done when the map $$X \to K(\pi_1 X, 1) \to \operatorname{cofib}(Y \to K(\pi_1 Y, 1))$$ is nullhomotopic.  This gives a sufficient (but not necessary) condition for an affirmative answer to your question.  I believe this also recovers the condition in Balarka's comment.  
