This page is very US-centric.
In the United States, a notary public is a public official appointed by the government to serve the public as an impartial witness. This should be contrasted with the Latin American notario publico who may be similar to an attorney or lawyer in the United States. In the United States, a non-attorney notary may not offer you legal advice, may not prepare documents for you, and cannot recommend how you should sign something or even what type of notarization is necessary.
Each state authorizes a notary to perform a limited range of activities called notarizations. California notary law will be considered here, see California Government Code Sections 8201 et. seq.
Notarization does not prove the truthfulness of statements in a document. Notarization does not legalize or validate a document. Notarization does not protect your rights in artistic creations or inventions.
Notarization requires that the notary screen the signer. This involves reviewing identity cards (drivers license, etc.) or testimony from one or more credible identifying witnesses. If you need a document notarized it is your responsibility to bring the necessary identification or witnesses. Next, the notary must complete a journal entry and finally the notary will complete the notarial act. In California, a thumbprint is required in the journal entry for certain types of transactions to prevent fraud. Documents with blank spaces cannot be notarized.
The two primary types of notarizations are acknowledgments and jurats.
Acknolwedgments are executed on deeds, documents affecting property, and the like. An acknowlegment is a signed statement by the notary that the signer (1) personally appeared before the notary, (2) was positively identified by the notary, and (3) that the signer acknowledged having signed the document.
A jurat (or oath) is designed to compel truthfulness in a signer, e.g. by putting the fear of the law/god in them. A jurat is a signed statement by the notary that the signer (1) personally appeared before the notary, (2) signed the document in the presence of the notary, and (3) took and oath or affirmation administered by the notary, e.g. "Do you swear that the statements in this document are true, so help you God?" or "Do you affirm that the statements in this document are true?". Note that California law does not require idenification of the signer for jurats, but few notaries will allow you to complete the notarization without identifying yourself.