Firstly, there are a few issues with a time-dependent potential, $V(x,t)$. Namely, if we apply Noether's theorem, the conservation of energy may not apply. Specifically, if under a translation,
$$t\to t +t'$$
the Lagrangian $\mathcal{L}=T-V(x,t)$ changes by no more than a total derivative, then conservation of energy will apply, but this resricts the possible $V(x,t)$, depending on the system.
We often treat each Schrödinger equation case by case, as a certain system may lend itself to a different approach, e.g. the harmonic oscillator is easily solved by employing the formalism of creation and annihilation operators. If we consider a time-dependent potential, the equation is generally given by,
$$i\hbar\frac{\partial \psi}{\partial t}=-\frac{\hbar^2}{2m}\frac{\partial^2 \psi}{\partial \mathbf{x}^2} + V(\mathbf{x},t)\psi$$
Depending on $V$, the Laplace or Fourier transform may be employed. Another approach, as mentioned by Jonas, is perturbation theory, whereby we approximate the system as a simpler system, and compute higher order approximations to the fully perturbed system.
Example
As an example, consider the case $V(x,t)=\delta(t)$, in which case the Schrödinger equation becomes,
$$i\hbar \frac{\partial \psi}{\partial t} = -\frac{\hbar^2}{2m}\frac{\partial^2 \psi}{\partial x^2} + \delta(t)\psi$$
We can take the Fourier transform with respect to $t$, rather than $x$, to enter angular frequency space:
$$-\hbar\omega \, \Psi(\omega,x)=-\frac{\hbar^2}{2m}\Psi''(\omega,x) + \psi(0,x)$$
which, if the initial conditions are known, is a potentially simple second order differential equation, which one can then apply the inverse Fourier transform to the solution.
The "independent" in "time-independent Schrödinger equation" doesn't mean that the wavefunction $\psi(x,t)$ is independent of time, but that the quantum state it defines doesn't change with time.
Since $\psi(x)$ and $\mathrm{e}^{\mathrm{i}\phi}\psi(x)$ for any $\phi\in\mathbb{R}$ define the same quantum state, this does not imply $\partial_t\psi(x,t) = 0$. Indeed, as the solution shows, the time dependence $\mathrm{e}^{\mathrm{i}Et}$ is precisely the kind of dependence that is allowed.
Best Answer
The derivation of the time-independent Schrödinger equation doesn't assume both sides equal a constant. It begins with the assumption that the wavefunction can be written as a product of two functions: one depending on the coordinate and one on time.
Edit: Adding details of argument
I am assuming $\varphi$ and $\psi$ are equations of just time and just position, respectively. That is,
$$ \varphi = \varphi(t) \\ \psi = \psi(x) $$
We have
$$ i\hbar\frac{1}{\varphi(t)}\frac{d\varphi}{dt}\left(t\right) = -\frac{\hbar^2}{2m}\frac{1}{\psi(x)}\frac{d^2\psi}{dx}\left(x\right) + V(x) \tag{1} $$
Note that the LHS is a function of $t$ and the RHS is a function of $x$, and $t$ is independent from $x$. Assume both sides are not constant, and that equality holds for some $t_o, x_o$.
$$ i\hbar\frac{1}{\varphi(t_o)}\frac{d\varphi}{dt}\left(t_o\right) = -\frac{\hbar^2}{2m}\frac{1}{\psi(x_o)}\frac{d^2\psi}{dx}\left(x_o\right) + V(x_o) = A \tag{2} $$
Since $t$ and $x$ are independent, if equality holds for $t_o, x$ such that $x \neq x_o$,
$$ i\hbar\frac{1}{\varphi(t_o)}\frac{d\varphi}{dt}\left(t_o\right) = -\frac{\hbar^2}{2m}\frac{1}{\psi(x)}\frac{d^2\psi}{dx}\left(x\right) + V(x) \tag{3} $$
(2) and (3) imply
$$ -\frac{\hbar^2}{2m}\frac{1}{\psi(x)}\frac{d^2\psi}{dx}\left(x\right) + V(x) = A \hspace{2em} \forall x $$
By similarly writing the equation for $t, x_o$ one gets the LHS of (1) to equal $A$ as well.