As has already been noted, it's not always possible to be sure. Scholars can and do have legitimate disagreements on whether a particular sign in a particular context was read out loud, or whether it simply acted as a silent determinative. That said, most of the time one can make a pretty good educated guess.
In practice (assuming that you're reading a text that someone else hasn't already transliterated) you start by checking if the sign you've found is one of the relatively small number of signs known to occur as determinatives. In Akkadian at least this was a fairly small and closed list, although I believe Hittite may have innovated some additional ones.
For example, Huehnergard (2011, 3rd ed.) p. 537 lists the following determinatives in Akkadian:
diš (=1/m), dingir (=d), dug, gi, giš, íd, iku*, iti/itu, kam/kám*, ki*, ku6*, kur, kuš, lú, munus (=mí/f), mul, mušen*, na4, síg, túg, ú, udu, uru, urudu, uzu
(* = placed at the end of the word or name it applies to)
Huehnergard also notes that some authors treat the logographic plural / collective markers MEŠ and HI.A as determinatives in Akkadian, rather than as parts of a compound sumerogram. In practice this makes no difference, since either way they just serve to mark a logographically written word as a plural. (In Sumerian, of course, they would've been pronounced: the suffix -meš derives from the Sumerian enclitic copula and essentially means "they are", while hi-a is a Sumerian participle meaning "mixed" or "various".)
Meanwhile, Theo van den Hout's The Elements of Hittite (which isn't really a reference work, but it's the only book I happen to have at hand that lists Hittite determinatives in a convenient format) mentions the following additional determinatives not in Huehnergard's list:
é, gada, gi, hur.sag, im, ninda, pú, sar*, tu7
If the sign you've found is not one of these, then it's not probably not a determinative. In particular, I don't believe LUGAL is known to occur as a determinative in either Akkadian or Hittite, so you should simply read it as the logogram for "king" (šarru(m) in Akkadian, hassus in Hittite, IIRC).
Anyway, if the sign you've found does occur as a determinative, the next step is to check whether it makes sense to read it as one in the context at hand. For example, in the phrase:
nu NINDA-an e-ez-za-at-te-ni = "(and) you (pl.) (will) eat bread"
it makes no sense to read NINDA as a determinative, since it's immediately followed by what looks like a phonetically written accusative case ending, so one should instead read it as a logogram for "bread" or "food". If you wanted to make sure, you could check a dictionary to see if there might be any known words for foodstuffs beginning with NINDAan- (which I don't think there are), but the clear and recognizable verb ezzatteni immediately afterwards rather clinches it.
In fact, checking a dictionary is often a good idea anyway, since many of the determinatives only occur with a limited number of specific words. Out of the already short list of determinatives listed above, only a small subset (off the top of my head, DIŠ, MUNUS, DINGIR, KI, KUR, URU, É, HUR.SAG, ÍD and maybe PÚ) occur with open classes of proper names that you might not find in a dictionary (and even then, if it's a previously attested name, you likely will find it in a good dictionary). The rest only occur with common names (e.g. TÚG for types of garments or UDU for terms for sheep or goats) or with fairly closed classes of proper names (e.g. MUL for names of stars and planets or ITI for months) that can be looked up.
Of course, all of that is basically relying on the work of earlier scholars who have translated texts and compiled dictionaries and determined how various signs should be read. While that's perfectly normal and inevitable, it does raise the question of how the reading (or lack of it, as it may be) of particular logograms could be originally determined.
One important source for this information is lexical lists, i.e. basically ancient dictionaries. Akkadian scribes at least loved to compile these, and they're quite well attested since copying them formed a part of the scribal curriculum. A typical Akkadian lexical list might contain, say, names of different gods or animals or professions, giving for each of them 1) a Sumerian logographic spelling, 2) a syllabic reading in Sumerian, 3) an Akkadian logographic spelling (which might or might not be the same as the Sumerian), 4) a syllabic reading in Akkadian and 5) a brief definition of what the term means. (Not all lexical lists included all of these things, but the provision of both Sumerian and Akkadian readings was common, since one important function of these lists was to teach scribes to read and write Sumerian.)
Such lexical lists provide direct evidence for how various sequences of logograms (or combinations of logograms and syllabograms) were meant to be read, and thus on whether any determinative-like signs in them were pronounced or not. A number of similar lexical lists in Hittite have apparently also survived, and have served as important sources of vocabulary.