How do I properly cite during an exam?
I do not think it is necessary to cite or give exact bibliographical information during a written exam. Even in publications, textbook knowledge does not have to be equipped with references.
In more detail:

I almost write everything as it is and without paraphrasing or even citing, is that plagiarism?
I get some ideas from outside the book and I do cite them in that case, however I do not paraphrase as I am learning by heart the thoughts in order to answer a specific question in the exam, is that plagiarism?

What troubles me here is not that you do not cite correctly, but that you just reproduce the exact wording from the textbook. To the examiner, this does only show that you are able to find the relevant section of the textbook to the question, but not that you understood the subject sufficiently to explain it in your own words. With this approach, you are completely lost in essay questions, and later in your thesis.

And lastly, since I am memorizing by heart, I sometimes misspell the name of an author or even change a bit of details in his or her idea, is that a bad thing?

Misspelling the name is certainly not a problem. Changing the ideas depends on what exactly changes, but I think this is a problem that arises from learning by heart instead of learning the theory, facts, and connections therein.