The other effect is that time in a strong gravitational field runs slowly.
If you move away from a clock, time seems to slow down as your distance to the clock gets larger and the time between a change on the clock reaches you over a longer period. But if you carry a clock in your rocket it will just tick at the same pace as on earth (minus the gravitational impact, which is measured but why does gravity have an impact on time...?)
Have a look at the simple inference example here: https://en.m.wikipedia.org/wiki/Time_dilation
Time doesn't necessarily slow down the further away you get from a clock. If you and a clock are both stationary (ie you're in the same inertial frame), you will observe it ticking in "normal" time, albeit delayed due to the distance. If the clock is moving relative to you however, you will measure its ticks to be slightly slower.
You may be confusing general relativistic effects which are distance dependent (as gravity weakens the further away you get).
If you carry a clock in your rocket, you will (in the rocket) measure it to tick once a second. When you get back to Earth, you'll find that it's lagged behind a clock that was started at the same time but was left on Earth.
Maybe have a look at simple wiki too https://simple.m.wikipedia.org/wiki/Special_relativity though it doesn't actually derive the Lorentz transforms unfortunately.
Ignore the gravity bit for now, that's general relativity and it's more complicated to explain.