This generally comes from putting consistent pressure on the palm of your hand and compressing and vibrating the ulnar nerve. Anything you can do to alleviate the amount of downward pressure you are putting by your hands onto the stem will help with this. You can get more ergonomic grips or gloves to help with the vibration and spreading out the pressure more across your hand. Or you can also adjust the stem upward or the seat slightly backward to put more of your weight on the saddle and less on the handlebars.
As you found, this is not something that goes away or you get used to. Repeated injury to the nerve will only make the numbness last longer in fact, and it can be permanent if you do it too much. Look up Cyclist's Palsy for more info.