The short answer
Much less than people think. The phrase appears once in The Wealth of Nations, in a chapter against import restrictions, in a sentence about why a merchant usually prefers to invest his money at home. It became the name of a doctrine only in the twentieth century.
Where it is
Book IV, chapter 2, is an argument against duties and prohibitions on foreign goods. In the course of it Smith observes that a merchant generally prefers to keep his capital in domestic trade, where he can watch it, and that by doing so for his own security he is led by an invisible hand to promote an end that was no part of his intention.
The passage is hedged throughout. Generally. As in many other cases. Not always the worse. Frequently. Four hedges, one in each of four sentences, from a man perfectly capable of writing without one.
Three times in all his work
Smith used the phrase three times in everything he published: here; once in The Theory of Moral Sentiments in 1759; and once, as the invisible hand of Jupiter, in an essay on the history of astronomy printed after his death.
What he said plainly instead
The sentence people think they are quoting comes at the end of Book IV, and it is plainer and stronger: every man, as long as he does not violate the laws of justice, is left perfectly free to pursue his own interest his own way.
It is followed in the same breath by the part that never travels with it: a list of what government must still do. Defence, justice, and the public works and institutions that no private person could make pay.
How it became famous
In 1948 the phrase entered the most widely used economics textbook in the world and became the name of a doctrine. Defenders of markets took that Smith as their founder, and critics took the same Smith as their target. Scholars still argue whether the idea of unintended order runs through his work even where the words do not. What the count settles is narrower: the phrase itself does not carry the doctrine.