When must I speak to a dentist about my yellow tongue?

Right away. A healthy tongue is not yellow. You should go see your dentist right away to see what the determining factored is and what the best course of action is.
Thrush. If there is pain as well, tis could be oral thrush, a fungal infection. Treatment involves rinses with an anti fin gal in most cases. If there is no pain, there are a number of considerations from vitamin deficiencies to acid reflux. Only a physical exam and complete history could provide an accurate diagnosis.