PHB, Pg. 177, Left Column under Hiding states:
"In combat, most creatures stay alert for signs of danger all around, so if you come out of hiding and approach a creature, it usually sees you. However, under certain circumstances, the Dungeon Master might allow you to stay hidden as you approach a creature that is distracted, allowing you to gain advantage on an attack before you are seen."
So assuming no distraction, you usually can't stay hidden if you approach the target.
PHB pg. 195 said:If you are hidden - both unseen and unheard - when you make an attack, you give away your location when the attack hits or misses.
This states that you can hide and still attack (while hidden). Most players who hide and don't have the wood elf ability, Skulker, etc., would be using cover to hide. So one could assume this passage includes folks who are using cover to hide. We know that if there is total cover between you and the target, you can't even make the attack (pg. 196). Jiving pg. 195 with pg. 177, one could conclude that a pop-up or pop-out (to get out from behind the total cover) is allowed and that you are still hidden at that point. However, if you then start to approach, you are no longer hidden unless there is a distraction.