Given t\in N the numbers modulo t, Z_t form a semigroup under multiplication. This semigroup decomposes into two disjoint subsemigroups, say \Phi_t,\Psi_t, being respectively the numbers relatively prime to t and the rest. The former is actually a group.
The mapping \kappa:Z_t\rightarrow Z_t s.t. \kappa:n\mapsto n^3 is a semigroup endomorphism of Z_t, and because ((n^3,t)=1)\equiv ((n,t)=1), it's also a semigroup endomorphism of both \Phi_t and \Psi_t. Then n^3 will represent all of Z_t iff \kappa:\Phi_t\rightarrow \Phi_t and \kappa:\Psi_t\rightarrow \Psi_t are both isomorphisms (by the Pigeonhole Principle).
\kappa is a group endomorphism of \Phi_t, and will be an isomorphism iff the kernel, \{n\in Z_t:n^3=1\} is just (e). By Lagrange and Cauchy's theorems this will be the case iff 3\nmid o(\Phi_t).
If t is prime then \Psi_t is just \{0 mod t\}, and \kappa is necessarily an isomorphism on \Psi_t. In this case o(\Phi_t)=t-1.
All primes other than 2 and 3 are of the form 6k\pm 1, so only when t=6k+1 will 3\mid t-1. Thus n^3 will represent all of Z_t for primes 2, 3 and t=6k-1.
If (r,s)=1, \Phi_{rs}\cong \Phi_r\bigotimes \Phi_s as groups. So n^3 will not represent all of Z_t if t has any prime factor t=6k+1. Morover if has a square factor, say t=s^2u, s>1, then (su)\neq 0(t), but (su)^3=0(t), hence \kappa:\Psi(t)\rightarrow \Psi_t cannot be an isomorphism.
This proves that every number is a cube mod t only if t is a square free product of primes of the form 2, 3 and 6k-1 and that n is a cube mod t whenever (n,t)=1 and t is of the given form.