Do boys stop growing when they begin to shave?
There is a mistaken notion that if two things happen one after the other, then the first must be the cause of the second. However, this is often not true. If I have the habit of walking in each evening, closing the door behind me, and announcing that I'm home, does this mean that closing a door makes me say that I'm home? Or, that the reason I came home is because the sun is starting to set? The chain of events are loosely connected, but one doesn't cause the other.
In the order of development, the growth of facial hair is toward the end, coming in Tanner's stage 4. By this time the bulk of your growth in height in done (this happened in stage 3). About all that is left is the lengthening of your trunk (from your shoulders to your waist) which only adds a few inches to your height at most. There is the widening of the shoulders and the development of muscles and chest hair as well. To estimate what stage of development you are in, see the Tanner Stage Calculator for Boys.
None of the events are absolutes. A person might develop in a slightly different order and still be considered normal. However, by the time a boy needs to shave most boys have completed most of their growth and have only a few more inches, at most, to grow in height.