There are two answer for this question.
First, we need to realize that Odysseus hides himself from many others and not just Penelope. Part of this is undoubtedly to keep his return a secret. In other words, if Penelope knows that Odysseus is at Ithaca, this could blow his cover. We need to keep in mind that if Odysseus is going to overcome the suitors, who are more powerful than he is on account of their numbers, he needs the advantage of a surprise attack. This point also fits well with the cunning of Odysseus.
Second, Odysseus also wants to see if Penelope has been faithful to him. It has been a long time (20 years) and it is possible that she has not been faithful. However, as he spends time with her, he realizes that she has been a model of faithfulness. She has outwitted the suitors. For example, Odysseus learned that Penelope stated that she would choose a suitor only after she finished making a burial cloak for her father-in-law. But every night she would undo it. In fact, her name in Greek, "Penelope" means spindle loosener.