What is the number of subgroups of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$? 
What is the number of subgroups of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$?

I know that a subgroup of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$ is isomorphic to $(\mathbb{Z}/2\mathbb{Z})^2$ because of the order of its elements, but I cannot say what is the number of this subgroups.
Also, is it possible to generalise this to the number of subgroups of index $2$ of $(\mathbb{Z}/2\mathbb{Z})^n$?

Any subgroup of index $2$ is normal, so your question is equivalent to "how many surjective homomorphisms are there from $(\mathbb{Z/2Z})^3$ to $\mathbb{Z/2Z}$?". So let's answer that question.
Consider the obvious $3$-element generating set (basis) for $(\mathbb{Z/2Z})^3$. Every homomorphism is defined entirely by where the elements of this set are sent to, which gives $2^3$ homomorphisms (a power of $2$ as each element has two possible images). However, we must exclude the situation where every generator is sent to the identity (as the homomorphism must be surjective), which gives $2^3-1=7$ surjective homomorphisms. Hence, there are $7$ subgroups of index $2$.
Generalising to $(\mathbb{Z/2Z})^n$: bases now have size $n$ which each basis element still has two possible images, hence we get $2^n$ homomorphisms $(\mathbb{Z/2Z})^n\rightarrow \mathbb{Z/2Z}$, so $2^n-1$ surjective homomorphisms/subgroups of index $2$.
