It's been implied in other answers, but not stated explicitly, that "time" is being used in two distinct meanings in "every time" and "all the time". As Barmar said in a comment, the former is countable (like beans) and the latter is uncountable (like water). The construction "every X" forces us to take a countable interpretation of X. Specifically, "every time" uses meaning 3.4 below (abridged from the "time" wiktionary entry with emphasis added) whereas "all the time" uses meaning 1 (or possibly a version of 2).
It's probably worth mentioning that you can use "every X" to get the sense of "all the time" if you divide time into countable units. A person who has (and is hopefully seeking help for) Generalized Anxiety Disorder might say:
- How often do I feel anxious? Every second of the day!
- How often do I feel anxious? Every waking moment!
time (countable and uncountable, plural times)
(uncountable) The inevitable progression into the future with the passing of present and past events.
- Time stops for nobody.
- the ebb and flow of time
A duration of time.
An instant of time.
3.1. (uncountable) How much of a day has passed; the moment, as indicated by a clock or similar device.
3.2. (countable) A particular moment or hour; the appropriate moment or hour for something (especially with prepositional phrase or imperfect subjunctive).
3.3. (countable) A numerical indication of a particular moment.
3.4. (countable) An instance or occurrence:
- When was the last time we went out? I don’t remember.
- see you another time
- that’s three times he’s made the same mistake
- Okay, but this is the last time. No more after that!
3.5 (UK, in public houses) Closing time.
3.6 The hour of childbirth.
3.7 (as someone's time) The end of someone's life, conceived by the speaker as having been predestined.
(countable) The measurement under some system of region of day or moment.
(countable) Ratio of comparison.
(grammar, dated) Tense.
(music) The measured duration of sounds; measure; tempo; rate of movement; rhythmical division.