Let $(a,c)=p_3 - p_1, (b,d)=p_2-p_1$, and $\Delta = ad-bc$. If $\Delta \neq 0$ (meaning that the vectors $p_3 - p_1$ and $p_2-p_1$ are not parallel) this problem has a solution.
Let $(x_i,y_i) = q_i - p_1$. Then $q_i$ maps to $\frac{1}{\Delta}(d x_i - b y_i, a y_i - c x_i)$.
Where did that come from?
We're told that $p_1$ maps to $(0,0)$, so we should translate everyone by $p_1$ to get the origins to match.
We are told that $p_2 - p_1$ maps to a unit displacement along the $y$-axis and that $p_3 - p_1$ maps to a unit displacement along the $x$-axis. Consider $M = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$. This $M$ takes the vector $\begin{pmatrix}1 \\ 0\end{pmatrix}$, a unit displacement along the $x$-axis to $\begin{pmatrix}a \\ c\end{pmatrix}$ and takes $\begin{pmatrix}0 \\ 1\end{pmatrix}$, a unit displacement along the $y$-axis, to $\begin{pmatrix}b \\ d\end{pmatrix}$. So if $(a,c)=p_3 - p_1$ and $(b,d)=p_2-p_1$, this matrix takes the unit square to the (translated to the origin) parallogram $P - p_1$.
We want to go the other way, so we want $M^{-1}$. First we find the discriminant of $M$, which is $ad-bc$. If this is non-zero, $M$ can be inverted. (This is equivalent to $\begin{pmatrix}a \\ c\end{pmatrix}$ and $\begin{pmatrix}b \\ d\end{pmatrix}$ not being parallel. The inverse is $M^{-1} = \begin{pmatrix} d/\Delta & -b/\Delta \\ -c/\Delta & a/\Delta \end{pmatrix}$.
Then we write each $q_i - p_1$ in coordinates, $(x_i, y_i)$, and apply $M^{-1}$ to it get the image point $\frac{1}{\Delta}(d x_i - b y_i, a y_i - c x_i)$.