There is no single standard for Latin pronunciation. The main division is between reconstructed pronunciation (based on our idea of what Classical Latin sounded like) vs. everything else. As Draconis mentioned, in reconstructed pronunciation <ti> is just pronounced as a sequence of the T sound [t] followed by one of the two I sounds, ĭ [i~ɪ] or ī [iː].
The development of assibilated pronunciations of <ti>
In most other pronunciation systems, <ti> has a special pronunciation where the T is "assibilated" in certain contexts. This pronunciation is based on a sound change that is thought to have occurred naturally in the development of the spoken language; however, I suspect that the "rules" that books give about when to use this pronunciation in modern speech may be partly artificial.
The hypothesis that I have seen about the origin of this pronunciation is that the /i/ in <ti> came to be realized as a non-syllabic glide/semivowel/approximant [j] before a vowel. Then the resulting sequence [tj] turned into [t͡sj], with a voiceless affricate [t͡s].
In some languages such as French and English, the affricate [t͡s] underwent further developments. French turned the affricate [t͡s] into a fricative [s]. In English, we usually see a change to [ʃ] (the sound of "sh" in "fish") and loss of the following [j] sound; for example, the English word nation is pronounced with [ʃ].
I don't know of any tradition of Latin pronunciation that uses an elongated sound in the pronunciation of <ti>. In fact, I've heard that Ecclesiastical Latin has specifically short [t͡s] in words like natio, in contrast to the long [tt͡s] sound that many Italian speakers use in Italian words like spazzi.
Although I described the sound change as turning [tj] into [t͡sj], in modern speech the pronunciation [t͡si], with a syllabic [i] in hiatus with the following vowel, can also be heard from some speakers for Latin <ti> followed by a vowel. Interchange between syllabic [i u] and non-syllabic [j w] is common in the history of Latin and its descendants; I'm not sure about the exact history of variation between [i] and [j] in this context.
Vulgar Latin also had sound changes affecting the pronunciation of -di-
Historically, Latin -di- also developed an assibilated pronunciation [d͡z] (and in vulgar Latin, -di- between vowels often showed an alternative development to a j or "soft g" sound [d͡ʒ], discussed in Alex B.'s answer here). But I think that in modern spoken Latin di is typically not assibilated.
The main conditions for not assibilating
Here are the conditions that I know of for using the assibilated pronunciation of T in Latin.
Don't assibilate unless the I comes before another vowel
The assibilated pronunciation of T in the sequence <ti> developed only when the I was followed by another vowel. (As I mentioned above, the original conditioning factor for the assibilation may have been a change of I to a glide [j], which was only possible before a vowel.)
Don't assibilate after the sound [s] (whether spelled S or X)
The assibilated pronunciation of T did not develop after the sound [s]. There are numerous examples with the spelling <sti>; there aren't so many with the spelling <xti>, but mixtio seems to be given by a number of sources.
(In English, the [tj] of words spelled with <sti> and <xti> developed for many speakers via palatalization to the affricate [t͡ʃ], as in the words bestial and question.)
Minor or unclear conditions for not assibilating
The following conditions are either less clear, or more marginal in scope (or both).
At the start of a word
I would not assibilate the T in a word starting with <ti> followed by a vowel. The only word I know of where this exception is relevant is the word tiara. I'm used to pronouncing [t] in the English word, and Italian also seems to have [t] rather than [t͡s] in tiara.
Lindsay 1894 cites Servius as saying that -ti- and -di- are subject to assibilation before a vowel in word-medial position, but not at the start of words: the examples given for non-assibilated di- and ti- are dies and tiaras (The Latin Language: An Historical Account of Latin Sounds, Stems and Flexions, p 83, §90).
After another T
Supposedly, the assibilated pronunciation of T is not used in words spelled with <tti>. There are very few examples of <tti> followed by a vowel in Latin, so I asked a separate question to try to determine the evidence for this rule: Why is it thought that T resisted assibilation after another T?
Despite the non-obviousness of this rule to me, sources seem to be fairly consistent in saying not to assibilate in this context, so I would recommend following that practice.
In (some) words from Greek (maybe also applies to TY)
I've seen a few sources that say that T was not or should not be assibilated in words from Greek. According to Blair (1873), "in Greek words (as Aegyptius), as the I is not consonantal, the T cannot be hissed" (Latin Pronunciation: An Inquiry Into the Proper Sound of the Latin Language during the Classical Period, p. 118). I have the impression that the actual pronunciation used with words of this sort is sporadic and might vary between different time periods. Despite what Blair says, I wouldn't recommend making a special exception for words like Aegyptius.
In certain forms of passive or deponent verbs with infinitives ending in -ti
In the infinitive pati, the I is not followed by a vowel, so it's regular to not assibilate the T. A number of sources say that the archaic infinitive forms ending in -ier like patier also have non-assibilated T, and so were exceptions to the rule (Blair gives nitier and quatier as examples, p. 118).
I found another source that seems to apply this exception also to finite forms such as patior ("The Correct Pronunciation of Latin According to Roman Usage", by Michael de Angelis, p. 20). But I'm a bit doubtful that this is actually an observed as opposed to a theoretical exception. There seems to be a spelling variant pacior, which implies that at least some speakers at some point in time assibilated the T in this word (in some varieties of spoken Latin, assibilated T sounded the same as "soft C").
When the I is long and/or stressed (very uncertain to me)
Blair (1873) says that the T in totius did not undergo the sound change of assibilation because the I was long (tōtīus) (p. 118). As Draconis mentioned, contrastive vowel length per se is lost in Ecclesiastical Latin, but it is not irrelevant in all cases to pronunciation: the position of stress in Ecclesiastical Latin corresponds to the stress of Classical Latin, which was assigned by a length-based rule. For example, termĭnus is stressed on the third-to-last syllable in both Classical and Ecclesiastical Latin, and bovīnus is stressed on the second-to-last syllable.
A complication in the case of totius is that an alternative scansion tōtĭus was used sometimes in poetry. I don't know whether this led to the development of an Ecclesiastical Latin pronunciation ˈto[t͡s]ius with initial stress. If a pronunciation of totius with stress on the second syllable is/was used in Ecclesiastical Latin, I'm not entirely sure whether it would be more regular for it to be toˈ[tsi]us or to[ˈti]us. This online "Guide to Latin Pronunciation" does give totius (without marking of the stress) as an example of a word where t is pronounced as [t͡s].
Long vowels rarely occur before other vowels in Latin. Aside from the small class of words with -īus genitives, such as tōtīus, ī followed by a vowel mainly shows up in words taken from Greek (which I mentioned above as a possible doubtful case for assibilation of T). Specifically, there are a fair number of words that end in -tīa (or at least, that are expected to based on the Greek form), such as necromantīa and goētīa. I don't know whether these have any single established pronunciation in Ecclesiastical Latin, or whether there is variation between pronunciations like necroˈman[ts]ia, necromanˈ[ts]ia and necromanˈ[t]ia.
The English form necromancy, with [s], is ultimately descended from some form with assibilation, but I don't know the details.
Italian seems to have [ˈtsia] in the word negromanzia, and also in some words from Greek -τία nouns like democrazia (from δημοκρατία). (Note: even though Greek -ία actually has a short vowel, the I ended up being stressed in languages like Italian.)
Italian does have nouns spelled with -tia and pronounced with [ˈtia], but all of the ones that I can find actually represent -thia (e.g. simpatia), so they don't seem directly relevant to the issue of pronouncing words that end in -tia in Latin.
All in all, when speaking in Latin according to the "Ecclesiastical" (Italian) style of pronunciation, I wouldn't try to make any exceptions to the assibilation of T based on stress, historical vowel length, or language of origin (even though, as you can see, some sources suggest that there are exceptions related to these things). I would just stick with the simple rules about assibilating TI before a vowel, except for after S, X, T, or at the very start of a word.