There is a straightforward way to deduce necessary conditions for a space curve to lie on an ellipsoid, and it's really a matter of calculation to make these conditions explicit in terms of the curvature and torsion.  I'll describe how to do this and the result of the calculation below, but first let me insert a note of caution about the 'necessary and sufficient conditions' that the OP wants.

When a space curve is *sufficiently* nondegenerate, i.e., its curvature $\kappa$ and torsion $\tau$ and the first derivative of its curvature with respect to arclength $\kappa'$ are nowhere vanishing, the necessary and sufficient condition for the curve to lie on a sphere is that the expression $\bigl((\kappa')^2 + \kappa^2\tau^2\bigr)/(\kappa^4\tau^2)$ be constant.  Indeed, when it is constant under these nondegeneracy hypotheses, this expression is just the square of the radius of the sphere on which the curve lies.  Note that the assumption that $\kappa'$ be nonzero is necessary:  If $\kappa'$ vanishes identically, then the above expression is constant (because the $\tau$-factors cancel), but not every curve with constant $\kappa$ lies on a sphere (for example, consider the circular helices, which have $\kappa$ and $\tau$ constant and nonzero).

Now, any curve that lies on a sphere has positive curvature $\kappa$, but it need not have nonvanishing torsion $\tau$, of course.  Thus, the above criterion does not make sense for all *nondegenerate* curves, i.e., space curves for which $\kappa$ is positive (which are the curves for which the classical Frenet frame is well-defined).  The following argument shows that one cannot hope to have a necessary and sufficient condition expressed in terms of local conditions for spherical curves that works for all *nondegenerate* space curves:  Consider two distinct spheres $S_1$ and $S_2$ that intersect along a circle $C$.  It is easy to construct a smooth curve $x(s)$ with positive curvature $\kappa$ that starts out on $S_1$ (but not on $S_2$), runs along $C$ for some interval, and then continues on $S_2$ (after leaving $S_1$).  This curve is locally spherical, but not globally spherical, so no local condition can be necessary and sufficient for all nondegenerate space curves. 

Meanwhile, one *can* get an expression that makes sense for all nondegenerate curves by considering the identity
$$
\frac{d\ }{ds}\left(\frac{(\kappa')^2 + \kappa^2\tau^2}{\kappa^4\tau^2}\right)
= \frac{2\kappa'\bigl((\kappa\kappa''-2\kappa'^2-\kappa^2\tau^2)\,\tau - \kappa\kappa'\tau'\bigr)}{\kappa^5\tau^3},
$$
which shows that any nondegenerate space curve that satisfies the nondegeneracy condition that $\kappa$, $\kappa'$, and $\tau$ be nonvanishing while 
$$
P(\kappa,\kappa',\kappa'',\tau,\tau') = (\kappa\kappa''-2\kappa'^2-\kappa^2\tau^2)\,\tau - \kappa\kappa'\tau' = 0
$$
must necessarily lie on a sphere (of some unspecified radius).  This is, in some sense, the correct statement of the classical result.

The reader may ask, "What about assuming real-analyticity?".  However, real-analyticity is not *necessary* for a space curve to be spherical, so this does not count as a local criterion that would be be part of a necessary and sufficient condition for any nondegenerate space curve to be spherical.  I think that the reasonable thing to do is to simply restrict to the appropriate class of *sufficiently nondegenerate* space curves, for which a necessary and sufficient condition to be spherical is available.  (Alternatively, one could restrict to the space of real-analytic nondegenerate space curves, but then one has to make a special exception for the curves with constant $\kappa$, etc.) 

The seriousness of this problem becomes evident in the case of what we might call *ellipsoidal* space curves, i.e., the space curves that lie on some ellipsoid.  Now, even the above nondegeneracy ($\kappa$, $\kappa'$, and $\tau$ be nonvanishing) is not sufficient to avoid the above difficulty, for one can easily write down a pair of ellipsoids that intersect in a space curve that is not planar and does not have constant $\kappa$ and hence contains such nondegenerate arcs.  In particular, one can construct such a nondegenerate space curve that is locally ellipsoidal but is not globally ellipsoidal.  Thus, even the right notion of 'nondegenerate' needs to be specified in order to get anywhere.

Here is what I propose:  Let $Q$ be the 10-dimensional vector space of quadratic functions on $\mathbb{R}^3$, i.e., functions of the form
$q = a_{ij}\,x^ix^j + 2b_i\,x^i + c$ for some constants $a_{ij}=a_{ji}$, $b_i$, and $c$.  For any smooth curve $\gamma:(a,b)\to\mathbb{R}^3$, let $Q^k_\gamma(t)\subset Q$ be the linear subspace consisting of those quadratic functions $q\in Q$ such that $q{\circ}\gamma$ vanishes to order at least $k$ at $t\in(a,b)$.  Then, for obvious reasons, $\dim Q^k_\gamma(t)\ge 10-k$ for $k\ge 0$.  

Let us say that $\gamma$ is *$Q$-nondegenerate* if $\dim Q^9_\gamma(t)=1$ for all $t\in(a,b)$.  It is easy to see that being $Q$-nondegenerate implies that $\gamma$ is fully nondegenerate (but is much stronger) and that being $Q$-nondegenerate can be expressed as the condition of non-simultaneous vanishing of a set of $9$ polynomials in $\kappa$ and $\tau$ and their derivatives with respect to arc-length up to order $6$ in $\kappa$ and $5$ in $\tau$.  Thus, it is an *open* condition on space curves.  Further, let us say that $\gamma$ is a *$Q$-curve* if it is $Q$-nondegenerate and $\dim Q^{10}_\gamma(t)=1$ for all $t\in(a,b)$.  This extra condition can be expressed as the vanishing of a certain polynomial $P$ in the $15$ variables $\kappa,\kappa',\ldots,\kappa^{(7)},\tau,\tau',\ldots,\tau^{(6)}$
that is of degree $27$ and has $8882$ monomial terms.  

One then has the following result:

**Theorem:**  A $Q$-nondegenerate space curve $\gamma$ lies on a (necessarily unique) quadric hypersurface if and only if it is a $Q$-curve.  Moreover, if it also satisfies a certain pair of strict inequalities on the curvature and torsion and their derivatives up to order $6$, then the quadric hypersurface on which it lies will be an ellipsoid.