Let $S$ denote an inertial frame, and let $S'$ denote the rocket frame.
Take, first, the case of zero acceleration where as viewed in $S$, the rocket frame moves at velocity $v$ in a straight line. If a clock that is stationary in the rocket frame measures an amount of time $\Delta t'>0$ between two events, then a clock in the inertial frame $S$ will measure an amount of time
\begin{align}
\Delta t = \gamma\Delta t'
\end{align}
where the factor $\gamma$, often called "relativistic gamma" is defined as
\begin{align}
\gamma = \frac{1}{\sqrt{1-\frac{v^2}{c^2}}}
\end{align}
and is constant when $S'$ is not accelerating. Now, we could ask,
Is an analogous expression relating time intervals in the two frames valid even when the rocket is accelerating?
Well, the answer to this is a bit tricky. If we try to blindly apply the formula, then we see that there is an ambiguity: which $\gamma$ would we use? Since the rocket frame is accelerating, it's gamma factor is constantly changing. However, if we pick a sufficiently small period of time, then we see that the gamma factor doesn't actually change very much, so we might be tempted to say that in the limit of vanishingly small time intervals $dt'$ and $dt$, we still have the relation
\begin{align}
dt = \gamma \,dt'
\end{align}
where here $\gamma$ is the value of gamma the rocket has during this "infinitesimal" time interval. It turns out that this is basically correct. In fact, we can make this more mathematically precise. To determine the time interval $\Delta t'$ between two events measure measured by someone in the rocket, we integrate
\begin{align}
\Delta t' = \int_{t_1}^{t_2} dt' = \int_{t_1}^{t_2} \frac{dt}{\gamma}
\end{align}
Here is also the more mathematically highbrow way of summarizing these facts:
If $x^\mu(\lambda)$ is a parameterized curve in Minkowski space as measured by some inertial observer $S$, then the amount of time $\mathrm{time}(\lambda_1, \lambda_2)$ measured by an observer that is stationary in the rocket between spacetime points $x^\mu(\lambda_1)$ and $x^\mu(\lambda_2)$ along its path is given by
\begin{align}
\mathrm{time}(\lambda_1, \lambda_2) = \int_{\lambda_1}^{\lambda_2}d\lambda\, \sqrt{\eta_{\mu\nu}\dot x^{\mu}(\lambda)\dot x^\nu(\lambda)}
\end{align}
where overdots denote derivatives with respect to $\lambda$, and $\eta_{\mu\nu} = (+1, -1, -1, -1)$ is the Minkowski metric.
I'd like to note that the reason this integration procedure works is an extra physical fact about the way the universe works that does not follow directly, mathematically from the Lorentz transformation, a transformation which holds between inertial frames. In fact, some people often call this fact the clock postulate. In fact, I posted my own question about this a while ago that you might find interesting:
Why do clocks measure arc-length?
You will probably also find this illuminating; John Baez discussing the affects of acceleration on clocks in the context of special relativity:
http://math.ucr.edu/home/baez/physics/Relativity/SR/clock.html