I am curious about the meaning of the word Q.E.D. that is often written after a proof of a theorem (some math books use this convention).
Edit: Is it similar to the box being placed after a proof of a theorem? Also, what is the history of the development from Q.E.D. to ■ ?

It's an abbreviation of quod erat demonstrandum, which is the Latin translation of a Greek phrase meaning "which had to be proven". To the ancient Greeks, a proof wasn't complete unless the last sentence in your proof was basically the statement of the theorem. Putting QED after that sentence was their way of saying, "and that's what I was trying to prove, so there, I've proved it".
We aren't so strict about proofs anymore, but as a practical matter it's very useful to have a definitive mark that indicates the proof is over. Some authors use Q.E.D. as that mark, some authors use the box. There is no difference in meaning, which one is used is just a stylistic choice of the author.
Per your edit: The box $\Box$ is actually called a tombstone. It had long been used in magazines to indicate the end of an article. Paul Halmos was the first mathematician to start using it to indicate the end of a proof.