In five years, Tom will be twice as old as Cindy. Thirteen years ago, Tom was three times as old as Cindy. How many years ago was Tom four times as old as Cindy?
1. Let \( t \) be Tom's current age and \( c \) be Cindy's current age.
2. According to the problem, in five years, Tom will be twice as old as Cindy:
   \[
   t + 5 = 2(c + 5)
   \]
3. Simplify the equation:
   \[
   t + 5 = 2c + 10 \implies t = 2c + 5
   \]
4. The problem also states that thirteen years ago, Tom was three times as old as Cindy:
   \[
   t - 13 = 3(c - 13)
   \]
5. Simplify the equation:
   \[
   t - 13 = 3c - 39 \implies t = 3c - 26
   \]
6. We now have two equations:
   \[
   t = 2c + 5
   \]
   \[
   t = 3c - 26
   \]
7. Set the two expressions for \( t \) equal to each other:
   \[
   2c + 5 = 3c - 26
   \]
8. Solve for \( c \):
   \[
   5 + 26 = 3c - 2c \implies 31 = c
   \]
   So, Cindy is currently 31 years old.
9. Substitute \( c = 31 \) back into one of the equations to find \( t \):
   \[
   t = 2(31) + 5 = 62 + 5 = 67
   \]
   So, Tom is currently 67 years old.
10. We need to find how many years ago Tom was four times as old as Cindy:
    \[
    67 - x = 4(31 - x)
    \]
11. Simplify and solve for \( x \):
    \[
    67 - x = 124 - 4x
    \]
    \[
    67 - 124 = -4x + x
    \]
    \[
    -57 = -3x
    \]
    \[
    x = 19
    \]
    So, 19 years ago, Tom was four times as old as Cindy.

The final answer is \(\boxed{19}\) years ago.