I would advise you to contact your doctor about how long you will need to take malaria pills. There are a number of different varieties of the medication, so he/she will need to advise you on the best course of action in your case.
Malaria is certainly a problem in certain parts of Kenya, especially the coastal regions of the country. As well as anti-malarial, it is best to take preventative measures against mosquito bites such as using repellant and sleeping under a mosquito net a night.
For more information on health matters check out the Healthcare in Kenya page.