$V$ and $W$ are both linear spaces.
I have a book, Thomas M. Apostol's Calculus, Volume II that gives a proof of the statement in the title. However, there is mention of something that I felt was redundant, and I'm not sure if the statement adds anything to the proof. I will give my own proof on here. It is essentially the same as Apostol's proof, but is missing one statement. Is my proof incorrect? If so, what is missing, and why is it important? Be as pedantic as necessary.
We have that $$e_1, e_2, ..., e_n$$ is a basis for the linear space $V$. Thus we know that any $x \in V$ can be written as $$x = \sum_{k=1}^{n} c_ke_k$$ Necessarily, for a linear transformation $T$ to map $e_k$ to an arbitrary element $u_k$, we must have $T(e_k) = u_k$ for $k = 1,2,3...,n$. Let there be a second linear transformation, $T'$, which does the same such that $T'(e_k) = u_k$. This leads us to the following. We can see that, for any x, we have: $$T(x) = T(\sum_{k=1}^{n} c_ke_k) = \sum_{k=1}^{n} c_kT(e_k) = \sum_{k=1}^{n} c_ku_k = T'(x)$$
Thus $T(x) = T'(x)$ for all $x \in V$. So we must conclude $T = T'$. This concludes the proof. (The fact that I didn't write down the derivation with $T'$ is not what is missing)
EDIT: I've received very quick responses. The extra thing was the following sentence: "If $x = e_k$ for some $k$, then all components of $x$ are $0$ except the $kth$, which is 1, so (2.8) gives $T(e_k) = u_k$, are required." I'm unsure what talking about the components of $x$ added to the discussion.
You and other respondents are confused because you haven't quoted Apostol's theorem and proof carefully.
Here is what the theorem actually says. I've bolded the part you bungled.
The sentence following the colon is what Apostol calls (2.8).
Because of the bolded phrase ("one and only one"), a proof of this theorem must show two things: (1) such a linear transformation exists, and (2) it is unique. Your proof only shows uniqueness. Apostol's proof shows both existence and uniqueness: the first paragraph shows the former, the second paragraph shows the latter.
Here is the first paragraph, showing existence:
What is Apostol doing here? He is proving there does exist a linear transformation $T$ with the property $T(e_k)=u_k$. Which transformation? It's the transformation defined by the formula (2.8). Apostol first checks (or rather, says it is easily checked) that formula (2.8) does indeed define a linear transformation. But this alone is not enough: he needs to prove the existence not of any old linear transformation, but one for which $T(e_k)=u_k$ for all $k$. The last sentence in the paragraph, the one you ask about, makes this final step explicit.