You need to make sure you buy a good brand of caulk. also remove all old caulk and dirt. Than make a mixture of half bleach and half water and spray and clean entire arrea. this will kill all mold and help prevent it from coming back. you than need to fill your tub up with water. than apply the caulk. You need to let the caulk dry completely! usually 24 to 48 hours depending on the directions on the caulk. Leave the water in the tub until caulk is dry and set. To keep the mold from coming back you will want to spray the caulk with the water/bleach mixture on the caulk once or twice a month to keep the mold from coming back.
You need to let the caulking cure for at least 24 hours before using the shower; then you need to apply a sealer on top of the caulking and let that cure for another 24 hours before using the shower. Also, it does need to be cleaned regularly.
First of all what you need to do is totaly remove all the old caulking and clean the area then, fill the bathtub full with water then use an expensive tub and tile caulking for the joint at the bottom,let this cure for 2 days. Drain the tub and your good to go.(The reason for filling the tub is that if you didn't do this the next time you go to fill the tub the weight of the water will pull away the caulking).
Make sure the surface where you are caulking is very clean and dry. Put a bead of caulk then follow it with your finger lightly making sure all areas are filled. Use the right caulk. Also try to have the caulk seal smooth, any pits or crevices will collect moisture and produce mold. Good luck.