At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
The sum can be an integer between 3 (1+1+1) and 18(6+6+6). So, it can take 16 distinct values. So the dice should be rolled 16+1 = 17 times to ensure the same sum is rolled twice(as is correctly stated in the reply above :) )
This follows from the Pigeonhole Principle which is a fancy same for the common sense occurrence that if n items are distributed among m containers and n > m , then at least one of the containers will contain more than one item.
In this particular problem, the number of possible distinct sums (16) is the number of containers and we are asked to find out the minimum number of items to ensure that at least one of the containers contains more than one item. If we roll the dice 16 times , it can happen that each time we get a different sum but if we roll it once more, then this time the sum we get has to be similar to one of the 16 sums we got earlier.
Now, say if the question asked how many times we should roll the dice to ensure we get the same sum 7 times, we would proceed similarly.
In that case if we roll the dice (6*16 +1) = 97 times we would ensure the same sum 7 times.
More generally, if n = km + 1 objects are distributed among m containers , one of the containers will contain at least k+1 items.