How to extend a basis for $\mathbb{R}^n$ to a basis for $\mathbb{R}^{n+1}$? How is it possible to extend a basis for space $\mathbb{R}^3$, for example, to a basis for space $\mathbb{R}^5$? As far as I have understood it is needed to add two extra vectors to the basis in $\mathbb{R}^3$ space. However, I don't get what are we doing with number of elements in each of these basis. I mean that if it is a basis in $\mathbb{R}^3$ then there are three linearly independent vector with three elements but if we extend it what do we do with two missing elements?
Example:
Let's have a basis in subspace $\mathbb{R}^2$ that is spanned by these two linearly independent vectors: $(1,2),(5,6)$. Now, I want to extend it to a basis in $\mathbb{R}^3$ space then we add the following vector: $(7,8,9)$. So, the result is: $(1,2,0(?)),(5,6,0(?)),(7,8,9)$
The question is not about finding the third vector rather than what to do with missing elements in less sets (see example).
 A: You have to view the lower dimension space as being $embedded$ in the higher dimension space.  for example, the x axis is a 1 dimensional subspace of the plane.  By itself, it's a 1 dimensional vectors space.  We IDENTIFY it with the isomorphic copy $<x,0>$ in $R^2$.  so in your case, you set the extra digits to 0.
A: To expand on Alan's answer (+1), whenever $m>n$, we can consider the embedding $\phi: \mathbb{R}^n \hookrightarrow \mathbb{R}^m$ where $\phi$ takes a vector in $\mathbb{R}^n$ and sends it to the vector in $\mathbb{R}^m$ whose first $n$ coordinates are the same and are $0$ thereafter$^\dagger$ (this embedding is not unique but is the "canonical" one, where $\phi(\mathbb{R}^n)$ is "where you'd expect").  It's not hard to show that a basis for $\mathbb{R}^n$ is still a linearly independent set of $n$ vectors when embedded into $\mathbb{R}^m$.  Therefore, you only need to find $m \! - \! n$ new vectors to complete the basis for $\mathbb{R}^m$.  Each will need to have at least one nonzero value in the last $m \! - \! n$ coordinates so that the "additional space" outside of $\phi(\mathbb{R}^n)$ gets properly spanned (or, in other words, to avoid a linear dependency with the embedded vectors).
You can get a basis for $\mathbb{R}^m$ starting with a basis for $\mathbb{R}^n$ as follows:
Let $\mathbf{v}_j$ be any vector in the basis $\{\mathbf{v}_i\}_{i=1}^n$ for $\mathbb{R}^n$.  Now consider $\phi(\mathbf{v}_j)$.  We will define $\phi_{k}(\mathbf{v}_j)$ for $1 \leq k \leq m \! - \! n$ to be the vector whose coordinates match $\phi(\mathbf{v}_j)$ everywhere, except it has a $1$ for its $(n\!+\!k)^\text{th}$ coordinate$^\ddagger$.
Then the set $\big\{\phi( \mathbf{v}_i)\big\}_{i=1}^n \cup \big\{ \phi_k(\mathbf{v}_j) \big\}_{k=1}^{n-m}$ serves as a basis for $\mathbb{R}^m$.

$^\dagger$For instance, if we consider the embedding $\mathbb{R}^2 \hookrightarrow \mathbb{R}^4$, then the vector $\langle 2, 6 \rangle$ gets sent to  $\langle 2, 6, 0, 0 \rangle$.

$^\ddagger$As an example, $\mathbf{v}_1 = \langle 1, 0 \rangle$ and $\mathbf{v}_2 = \langle 2, 3 \rangle$ serves as a basis for $\mathbb{R}^2$, and we will extend this to a basis for $\mathbb{R}^4$.  First, $\phi(\mathbf{v}_1) = \langle 1, 0, 0, 0 \rangle$ and $\phi(\mathbf{v}_2) = \langle 2, 3, 0, 0 \rangle$.  If we let the $j$ from above equal $2$, then $\phi_1(\mathbf{v}_2) = \langle 2, 3, 1, 0 \rangle$ and $\phi_2( \mathbf{v}_2) = \langle 2, 3, 0, 1 \rangle$.
So a basis for $\mathbb{R}^4$ would be $\Big\{ \phi(\mathbf{v}_1), \ \phi(\mathbf{v}_2), \ \phi_1(\mathbf{v}_2), \ \phi_2(\mathbf{v}_2) \Big\}$.

One final quibble: Technically, $\mathbb{R}^2$ is not a subspace of $\mathbb{R}^3$ in the sense that $\mathbb{R}^2 \subset \mathbb{R}^3$.  Rather, there is a subspace of $\mathbb{R}^3$—namely $\{(x, y, 0) \ | \ x, y \in \mathbb{R} \}$—which is isomorphic to $\mathbb{R}^2$ (as vector spaces).  Because of this, $\langle 1,2 \rangle$ cannot be thought of as a vector in $\mathbb{R}^3$; this was the motivation for thinking about the embedding.  In the same vein, you'll often hear people talk of $\mathbb{R}$ as a subset of $\mathbb{R}^2$.  The intended meaning is usually clear, but know that this is an abuse of terminology.
