A necessary and sufficient condition for a space curve to lie on a ellipsoid Any (arc-length parametrized) space curve is uniquely determined (up to rigid motion) by its curvature  and its torsion.
For instance we know that a necessary and sufficient condition for a space curve to lie on a sphere is 
$R^2+(R')^2T^2=const$, where $R=1/\kappa$, $T=1/\tau$, and $R'$ is the derivative of $R$ relative to $s$.
I want to know if there is a necessary and sufficient condition for  a space curve to  lie on  a ellipsoid (in terms of its curvature and  torsion).
 A: Robert describes the differential equations which one can write in terms of $\tau$ and $\kappa$, and the inherent limitations in this local approach. But maybe one can find more reasonable or useful conditions in terms of integral equations, and the whole problem could be  more interesting or natural if we consider closed curves. In other words, a global approach could be more enlightening.
For instance, a necessary condition for a closed curve to lie on a sphere is that $\int \tau=0$, e.g. see p.171 of Millman and Parker, which incidentally turns out to characterize spheres. Furthermore, any closed curve lying on a convex surface must have at least $4$ points where $\tau=0$, which is a generalization of the classical four vertex theorem due to Sedykh; see also this paper for another proof, and this paper for a generalization. Another necessary condition for a curve to lie on an ellipsoid is that it have a pair of parallel tangent lines, which turns out to characterize ellipsoids, as described in this paper with Bruce Solomon. 
It would be interesting to find more simple or nice necessary conditions for a closed curve to lie on an ellipsoid, and I think it is possible that a collection of these may turn out to be sufficient as well.
Addendum 1: I found a nice paper which seems to be relevant:
Kreyszig, Erwin; Pendl, Alois
Spherical curves and their analogues in affine differential geometry. 
Proc. Amer. Math. Soc. 48 (1975), 423–428. 
In this paper the authors define a curve to be spherical in the affine sense if all its normal planes pass through a common point. If I am not mistaken these include curves which lie on ellipsoids, but other curves as well. At any rate, they obtain a very nice characterization for these "affine spherical curves":
$$
\left(\frac{1}{\widetilde\tau}\right)''+\frac{\widetilde\kappa}{\widetilde\tau}=0,
$$
where $\widetilde\kappa$, $\widetilde\tau$ are the affine curvature and torsion and diferrentiation is with respect to affine arc length. 
Addendum 2: Maybe a necessary condition could be that $\int\widetilde\tau=0$, but this is just a quick guess.
A: 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$.  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 and works 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}.
$$
In fact, any space curve that satisfies the nondegeneracy condition that $\kappa\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 radius $r$ where $r^2 =\bigl((\kappa')^2 + \kappa^2\tau^2\bigr)/(\kappa^4\tau^2)$ .  This is, in some sense, the correct statement of the classical result.  (Proof:  If the above equation holds and $\kappa\tau$ is nonvanishing, then the corresponding space curve $X:(a,b)\to\mathbb{R}^3$ satisfies the condition that $\bigl((\kappa')^2 + \kappa^2\tau^2\bigr)/(\kappa^4\tau^2)$ be constant.  Moreover, if $T$, $N$, and $B$ are the Frenet frame of $X$, so that $X' = T$, $T' = \kappa N$, $N' = -\kappa T+\tau B$ and $B' = -\tau N$, where the prime denotes differentiation with respect to arclength, then the curve $Y = X + (1/\kappa)N - (\kappa'/(\kappa^2\tau)) B$ satisfies $Y' = 0$.)
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.
