I can prove that there at most $2$ homotopy classes of maps from $\mathbb{C}P^2$ to $\mathbb{C}P^1$. However, I can't prove or disprove that there are exactly $2$. Perhaps someone can answer the final question and finish this off? (Or provide a completely different proof!)
I'll use the notation $[X,Y]$ to refer to homotopy classes of maps from $X$ to $Y$.
Claim 1: Fix a space $X$ and suppose every map $f:X\rightarrow S^2$ induces a trivial map on $H^2$. Then, the Hopf projection map $\pi:S^3\rightarrow S^2$ induces a bijection from $[X,S^3]$ to $[X,S^2]$.
Proof: First, note that $f$ induces $0$ on $H^2$ iff there is a map $\tilde{f}:X\rightarrow S^3$ with $\pi\circ \tilde{f} = f$. (I can supply a proof if desired). Then the map which assigns to $f\in[X,S^2]$ the map $\tilde{f}\in [X,S^3]$ is the inverse of the map induced by $\pi$. $\square$
Edit A proof that $f$ induces the $0$ map on $H^2$ iff it lifts was desired, and resulted in this question and answer. End edit
Claim 2: If $X = \mathbb{C}P^n$ with $n > 1$, then every map $f\in [X,S^2]$ is trivial on $H^2$.
Proof: Look at the cohomology ring structure. We have $H^\ast(\mathbb{C}P^n) \cong \mathbb{Z}[z]/z^{n+1}$ with $z$ in degree $2$. If $x$ generates $H^2(S^2)$, then $f^\ast x = kz$ for some $k\in \mathbb{Z}$. But then, since $x^2 = 0$, $0 = f^\ast (x^2) = (f^\ast x)^2 = k^2z^2$ which implies $k = 0$. $\square$
Corollary: There is a bijection between $[\mathbb{C}P^n, S^2]$ and $[\mathbb{C}P^n,S^3]$ for any $n > 1$.
Now, we show there are at most 2 elements in $[\mathbb{C}P^2, S^3]$ for any $n$. The main tool we use is the Thom-Pontryagin construction which provides, for any closed manifold $X$, a bijection between $[X,S^k]$ for any $k$ and codimension $k$ closed framed submanifolds of $X$, modulo framed cobordism. (A framed submanifold is a submanifold with trivial normal bundle, together with a choice of trivialization. A framed cobordism $W$ between two framed manifolds $M_1$ and $M_2$ is a manifold with boundary $\partial W = M_1\coprod M_2$, together with trivialization of the normal bundle of $W$ which restricts to the chosen trivializations on $M_1$ and $M_2$)
Since we're focusing on $k=3$ and $\mathbb{C}P^2$, of dimension $4$, we're looking at codim 3, that is, $1$-dim closed submanifolds of $\mathbb{C}P^2$. Recall that every $1$-d compact manifold is a disjoint union of a finite number of circles.
Given two embedded circles in $\mathbb{C}P^2$, there are obviously homotopic as $\pi_1(\mathbb{C}P^2) = 0$. Whitney has proved that of you have two homotopic embeddings of $M$ into $N$ with $\dim N \geq 2\dim M + 2$, then they are isotopic. The image of an isotopy is a cobordism between start and end times, so, we may assume wlog that any framed $1$-dim submanifold we are considering lives in a chart of $\mathbb{C}P^2$, that is, as a subset of $\mathbb{R}^4$.
Claim 3: There are precisely two framed $1$-d submanifolds of $\mathbb{R}^4$, up to framed cobordism.
Proof: Since any framed cobordism is a compact subset of $\mathbb{R}^4$, it's still embedded into the compactification of $\mathbb{R}^4$, that is, of $S^4$. By the Pontryagin-Thom construction, there is a bijection beteen $[S^4, S^3] = \pi_4(S^3) = \mathbb{Z}/2\mathbb{Z}$ and framed $1$-d submanifolds of $S^4$ modulo framed cobordisms. $\square$
In $\mathbb{R}^4$, or $S^4$ representatives for the two framed cobordism classes are as follows. First, one can use $S^1$ with a trivial parallel framing. More specifically, using $S^1 = \{(\cos \theta, \sin \theta, 0,0)\}$, one can use the framing $\{v_1,v_2,v_3\} = \{ (\cos\theta, \sin\theta, 0,0), (0,0,1,0), (0,0,0,1)\}$. Second, one can use $S^1$ with a once twisted framing. More specifically, one can use the framing $\{w_1,w_2,w_3\} = \{ \cos \theta v_1 + \sin\theta v_2, -\sin\theta v_1 + \cos\theta v_2, v_3\}$.
Now, for the question.
Question: Thinking of both $S^1$s with framing as subsets of $\mathbb{R}^4\subseteq \mathbb{C}P^2$, is there a framed cobordism between them in $\mathbb{C}P^2$?
If so, then all maps from $\mathbb{C}P^2$ to $S^2$ are homotopically trivial. If not, there is precisely one nontrivial map, up to homotopy. Note that if such a cobordism exists, it must, by claim 3, not be contained in any chart of $\mathbb{C}P^2$.