I'm almost sure I have a yeast infection. I have medicine but I would like to know how long I take the medicine?

Depends on medicatio. If you are taking over the counter yeast medication then follow the directions for use written on the box. Different medications have different timelines. If you are taking prescription yeast medication the follow the instructions on the package.
Yeast infection. Is it an oral medication or a vaginal suppository/ cream? The amount of time will depend on which medication you are using. Each medication should state how long is to be used. Take care.