Time dilation occurs in both Special relativity, where a stationary observer and a moving observer would measure two different time intervals between the same event, and General relativity, where an observer in a strong gravitational field measures a different time interval between two events than an observer in a weaker gravitational field.
In the Special Relativistic case, all we need is an idealized (for the sake of brevity and comprehension) version of the twin paradox. Ignoring acceleration, a spaceship leaves earth with a velocity $v$, travels in a straight line, and turns around at some point and travels to earth with velocity $-v$ (same speed, opposite direction). SR tells us that the time measured by the spaceship $t'$ is related to the time measured on Earth $t$ by $$t'=t\sqrt{1-v^2/c^2},$$ where c is the speed of light. We know that $t'/t=$ (1 day)/(1000 years) = $1/365,000$. Solving for $v$, we can show that if the ship travels at 99.9999999996% the speed of light, and turns around after 12 hours, the ship will return after 1000 years have elapsed in Earth time.
In the General Relativistic case, we can imagine an observer near something very dense and massive, like a black hole or neutron star, comparing times with an observer on earth. Again idealizing the problem significantly, we can relate the stellar observer's time $t'$ to the Earth time $t$ by the equation $$t'=t\sqrt{1-2GM/rc^2},$$ where G is the gravitational constant, M is the mass of the black hole, r is the distance the stellar observer is from the center of mass of the black hole, and c is again the speed of light. This depends on both M and r, but if we choose an arbitrary M, like the mass of the nearest known black hole, V616 Monocerotis (approx. 10 times the mass of our sun), we can find out how far away we would have to be from its center of mass in order to get the specified time dilation $t'/t=1/365000$. Solving for r, we find that an observer would need to be about 20 nanometers from the event horizon of V616 Monocerotis in order to experience a time dilation of this magnitude.