Why is the direct product of a finite number of nilpotent groups nilpotent?
Let $G=H\times K$. Note that $[(h_1, k_1), (h_2, k_2)] = ([h_1, h_2],[k_1, k_2])$, and so
$$[H\times K, H\times K]=[H, H] \times [K, K]=H_1\times K_1.$$
Similarly,
$$[H\times K,H_1\times K_1]= [H, H_1] \times [K, K_1]=H_2 \times K_2,$$
etc.
Assuming $H$ and $K$ are nilpotent, there exists and $i$ such that $G_i=H_i\times K_i=\langle 1\rangle$, and so $G$ is nilpotent.
The class of a nilpotent group $Q$ is defined to be the unique number $c$ such that $Q_c$ is trivial but $Q_{c-1}$ is non-trivial. Then, for $G=H\times K$ where $H$ is of class $c$ and $K$ is of class $d$, then the above working shows that $G$ is of class at most $\max(c, d)$.
Thus, the direct product of two nilpotent groups is nilpotent, and a simple inductive argument completes the proof.
This result is a specific case of a well-known result, called Fitting's Theorem, and the working to prove both of them is rather similar. Fitting's Theorem says the following,
Theorem:(Fitting's Theorem) Let $M$ and $N$ be normal nilpotent subgroups of a group $G$. If $c$ and $d$ are the nilpotent classes of $M$ and $N$, then $L=MN$ is nilpotent of class at most $c+d$.
In our case, these conditions all hold, we just have the additional conditions that $G=MN(=L)$ and that $M\cap N=1$, which makes our life easier. To prove Fitting's Theorem, start by proving that for $U, V, W\lhd G$ we have $[UV, W]=[U, W][V, W]$ and $[U, VW]=[U, V][U, W]$. The nilpotency of $L$ follows quickly. I will leave you to prove the class is $c+d$ on your own.
The class of all nilpotent groups of nilpotency class at most $c$ is exactly the collection of all groups for which the group word $$[x_1,x_2,x_3,\ldots,x_{c+1}]$$ evaluates to $1$ for all possible choices of $x_1,\ldots,x_{c+1}$ in the group (here, commutators are $[a,b]=a^{-1}b^{-1}ab$, and we write them left-normed, so that $[a,b,c] = [[a,b],c]$).
Since a collection of groups that is defined by group words forms a variety, and is closed under quotients, subgroups and arbitrary direct products, it follows that an arbitrary direct product of nilpotent groups of class at most $c$ is always nilpotent of class at most $c$.
If you have a finite collection $G_1,\ldots,G_n$ of nilpotent groups, then letting $c_i$ be the class of $G_i$, we can let $c=\max\{c_1,\ldots,c_n\}$; then each $G_i$ is nilpotent of class at most $c$, and thus the product is nilpotent of class at most $c$.
More generally any family of groups with bounded nilpotency class will have a product which is nilpotent (of class at most the common bound for the class).
On the other hand, taking a product of groups of unbounded nilpotency class will yield a group that is not nilpotent.
(The same idea works to show that any family of groups of bounded solvability class is solvable, and in particular that any finite family of solvable groups has solvable product).
One nice characterization of finite nilpotent groups is that a finite group is nilpotent if and only if it is the (internal) direct product of its Sylow subgroups (or equivalently, every Sylow subgroup is normal). From this characterization the fact that you want follows almost immediately.
Here's a proof which works for finite or infinite nilpotent groups. If $G = G_1 \times G_2 \times \ldots \times G_n$, then $Z(G) = Z(G_1) \times \ldots \times Z(G_n)$, so that $G/Z(G) \cong G_1/Z(G_1) \times \ldots \times G_n/Z(G_n)$. Continuing in this way, you can see that if the upper central series for each $G_i$ eventually reaches $G_i$, (ie, if each $G_i$ is nilpotent), then the upper central series for $G$ eventually reaches $G$ (ie, $G$ is nilpotent).