Helen Stoner is no longer in mourning for her sister Julia, who died almost exactly two years before Helen comes to see Sherlock Holmes. The traditional period of mourning was one year. There would have been no need for Helen to go on wearing mourning clothes any longer than that.
Helen is an inexperienced young woman who has always lived a sheltered life. She knows very little about traveling and probably does not like traveling alone. Her main concern is to consult Sherlock Holmes. Her secondary concern is to do so without having her stepfather find out she has done so. She is obviously terribly afraid of Dr. Roylott, and she gives many indications that she suspects him of having had something to do with the death of her sister Julia. This is largely a matter of "woman's intuition." Either he killed Julia or he had someone else, probably a gypsy, do the deed. So it is a matter of great importance to her that her stepfather should not find out she had been to see the famous detective.
This is why Helen, quite naively, is heavily veiled. She thinks that if people can't see her face, they won't be able to provide Dr. Roylott with any information about her, if he were to try to follow her. Perhaps the only heavy veil Helen owns is the one she wore with the black gown while she was in mourning for Julia. So Helen puts on the black gown and the black veil to go with it--and thereby she only makes herself more conspicuous. There would be very few women traveling alone in those Victorian times, and everybody would remember seeing a young woman in a black gown and a black veil.
Here is Watson's description of Helen when he first sees her in the sitting room at Baker Street.
A lady dressed in black and heavily veiled, who had been sitting in the window, rose as we entered.
Helen obviously needs help. She is totally incapable of coping with a man like Dr. Roylott. She has been ridiculously easy for him to follow to Baker Street. He storms into Holmes' room only minutes after she has left. Later when Holmes sees her at Stoke Moran he advises her to stay in her bedroom and avoid any contact with Roylott.
“We have had the pleasure of making the doctor's acquaintance,” said Holmes, and in a few words he sketched out what had occurred. Miss Stoner turned white to the lips as she listened. “Good heavens!” she cried, “he has followed me, then.”
When Dr. Roylott found that Helen had left the house, he naturally assumed that she had gone to London. She had no place else to go. He took a train from Leatherhead to Waterloo Station in London and then asked cab drivers if they had seen a young woman traveling alone. He would have been able to tell them approximately when she had arrived at Waterloo. She might have been the only female commuter at that time of morning. One of the drivers would have remembered taking her to 221B Baker Street. The veil, as we have said, only made her all the more conspicuous. What she should have done was to have taken a cab to one destination, such as a shop or restaurant, and then switched to another cab to get to Baker Street. But Helen Stoner is completely inexperienced and ingenuous.
Although she heeds Holmes' warning to stay in her bedroom, there would be nothing to prevent her stepfather from pounding on her door and insisting on questioning her. However, he probably decided to say nothing about her visit to Sherlock Holmes because he didn't want to spoil his plans to kill her. He doesn't realize that Holmes had already been at Stoke Moran that afternoon and had told Helen about her stepfather's visit.
Roylott wants to have normal relations with his stepdaughter and not do or say anything to arouse her suspicions. Ordinarily he might postpone his plans to kill her with his snake and wait until Holmes had lost interest. After all, Helen can't afford to pay Holmes, so Roylott would assume that Holmes had already given her his best advice and would not become further involved. But time is of the essence. Helen may get married in one month, and Roylott cannot afford to give her the one-third of her mother's capital to which she would be legally entitled.
Helen was still in mourning for her late sister, and wearing a veil was a common practice of mourning women in Victorian England.
More importantly, she didn't want anyone to know that she had sought Sherlock Holmes' help. She didn't know who had killed her sister, only that it involved a "speckled band," as her sister had said with her dying breath. Helen strongly suspected foul play, which was why she sought Holmes' aid, but she didn't know who was behind it. Her father was a likely suspect because he had motive, but there was no evidence tying him to means or opportunity.
Sherlock later determined the means and opportunity, and foiled the attempt made on Helen's life by her father. I won't spill anymore details, that would ruin the mystery.
So that no one will be able to recognize her. Her father, for example, was responsible for the killing of her sister.