Gestation for hamsters is about 16 days for Syrian hamsters and about 18 days for dwarf hamsters. But unless you were present during the mating and know the exact day that it occurred, you may not know for sure when your female got pregnant. Often, it is not obvious until a few days before she is ready to give birth.
But if you suspect that your female hamster is pregnant, leave her alone and do not handle her. It is not a good time to be picking her up, petting her or trying to play with her. She will be uncomfortable and protective, and may bite as a result. You also risk injuring her or the babies, especially if she is resistant to being picked up and tries to get away or jump out of your hand.
As a matter of fact, one of the signs that she may be pregnant is if her behavior changes and she resists being picked up and handled. She may also become aggressive toward her mate, so it is important to keep them separated.
So instead of handling her, nurture her and the babies by providing good nutrition and a safe, healthy environment while she is pregnant. This is a good time to make sure she gets plenty of fresh water and fresh veggies and fruit, and healthy protein like fresh cooked meat, hard boiled eggs or tofu.
Make sure that that the mother has lots of clean bedding and nesting material for giving birth and caring for her new babies. Also make sure the cage is kept clean, well ventilated with fresh air, but away from extremes of heat, cold or drafts.
Once the pups are born, do not handle them or touch them for at least 3 weeks. Touching the babies too soon is very threatening to the mother, and in her fear she may decide to eat them rather than expose them to danger. So do not put her in that position. Just leave the babies alone and provide their mother with healthy food and living quarters so she can take care of them safely and naturally.
If your female is not already pregnant, here are some things to consider. Although physically able to breed as young as 5 weeks old, it is better to wait until she is about 16 weeks old. This will increase the probability that the mother will bear healthy babies, and that she will be healthy and mature enough to take care of her litter.
Of course, most experienced hamster owners will advise against breeding them at all. Without complete knowledge of their genetic history, there is a high risk of potential health problems which can lead to heartbreak and expense for owners. So the usual recommendation, especially to new hamster owners and children, is to always keep the genders separated and enjoy taking care of the hamsters as pets.