First let $k \geq n$, since there will be no one-to-one functions otherwise.
For the first element of $A$, there are $k$ possibilities for its image under the function (just choose any element of $B$).
For the second element of $A$, there are only $k-1$ possibilities for its image. This is because we can choose any element of $B$ except the element chosen in the first step (since this would violate one-to-oneness.)
Continue in this way until you reach the final (i.e. $n$th) element of $A$. There are $k - (n - 1) = k - n + 1$ possibilities for its image, since we again must choose some element of $B$ that has not been used in the previous $n-1$ steps.
To get the total number of one-to-one functions, we multiply the number of possibilities we have at each stage (this technique is sometimes known as the Rule of Product). We get
k(k-1)(k-2) \cdots (k - n + 1)
one-to-one functions. This can be written more concisely as