When does the expected value or variance of the $t$ statistic exist? The distribution of Student's $t$ statistic is known when the random variable $x$ follows a Normal distribution. Sometimes, however, we apply it to random variables drawn from other distributions. I am curious if there are known conditions, sufficient and necessary, that the expectation of the $t$ statistic, or its variance, are known to exist (i.e. be finite).
For example, in the extreme if $x$ were drawn from a Bernoulli distribution, there would be a non-zero probability the sample variance is zero, and thus $t$ is infinite or not defined, and the expectation of $t$ does not exist. So presumably "the sample variance is positive almost surely" is a necessary condition. I am looking for more conditions like this (and ones that are easier to check).
 A: The case of independent and identical distributions for the variables $X_i$ in the sample
The (non-central) t-distribution is proportional to the distribution of the inverse of the tangent of the angle of the sample $\vec{x}$ with the diagonal line $x_1 = x_2 = \dots = x_n$.
$$t = \frac{\sqrt{n-1}}{\text{tan}(\theta)}$$
The problematic case is when this angle is 0 degrees in which case $\tan(\theta) = 0$ and the inverse is infinite.
Discrete distribution
In your example with a Bernoulli distribution you have a discrete distribution and there is a non-zero probability that $\theta = 0$, or that the sample $\vec{x}$ is on the diagonal line.
Whenever that probability is non-zero then the mean of $t$ (and other moments) will be infinite or undefined. This happens with any iid discrete sampling because there is a non-zero probability
$$P(X_1 = X_2 = \dots = X_n) = \sum_{\forall x} P(X=x)^n$$
Continuous distribution
One can imagine the distribution of the sample $\vec{x}$ projected onto a sphere of radius $1$ and see how it is distributed near the two points of the intersection with the diagonal.
For continuous distributions, the probability that $\theta = 0$ will be zero (unless you have fully correlated sample), but what also matters is how the density changes in the neighbourhood of $\theta = 0$.
For the expected value to be finite we need to have the second derivative of the distribution of $z = \tan(\theta)$ to be zero in the point $z=0$. Since
$$E[1/z] =  \int_{-\infty}^{0} \frac{1}{z} f(z) dz + \int_0^\infty \frac{1}{z} f(z) dz$$
...
To be continued I imagine that we can come up with some distribution that concentrates in one or more values such that for cases with $n = 3$ we do not have a finite mean (unlike the case of a normal distribution). Also when $X$ already has finite mean, then probably $t$ will have a finite mean as well.
A: One way to investigate this is by simulation. Since the question is about existence of moments, we could use some estimator of the tail index of the distribution of the T statistic, which is related to existence of expectation and other moments a definition of tail index here.
For an example I will simulate $N=100000$ times from a uniform distribution on $(-1,1)$. The distribution of the T statistic is

with a $t_4$-density overlaid. But it is the tail behavior which is most important, which is difficult to judge from such a plot.  Let us try a relative distribution plot, again comparing to the $t_4$:

which indicated heavier tails.  Then let us try the Hill estimator:

(the lower curve is EPD estimator, see code below). This at least indicates a tail index < 1, so that expectation do not exist, in contrast to the $t_4$.
R code:
sim_Tstat <- function(N, n, rparent=rnorm, mu_0=0) {
  Tstat <- replicate(N, 
                     {x <- rparent(n)
                      t <- sqrt(n)*(mean(x)-mu_0)/sd(x)
                      t})
  return(Tstat)
}

library(ReIns)
library(reldist)

set.seed(7*11*13)

test <- sim_Tstat(1E5, 5, rparent=\(n){runif(n, min=-1, max=1)})

hist(test, prob=TRUE, xlim=c(-5,5), breaks="FD")
plot( \(x) dt(x, df=4), from=-5, to=5, col="red", add=TRUE)

reldist(test, qt(ppoints(1E5), df=4), method="bgk") 

Hill(test[test>0], plot=TRUE)
EPD(test[test>0], add=TRUE)

A: 
The distribution of Student's t statistic is known when the random
variable x follows a Normal distribution. Sometimes, however, we apply
it to random variables drawn from other distributions. I am curious if
there are known conditions, sufficient and necessary, that the
expectation of the t statistic, or its variance, are known to exist
(i.e. be finite).

If the observations are normally distributed, the t-statistic follows a t-distribution under the null hypothesis, but note that with many observations it amounts to the standard normal distribution. The "other distributions" you mention for observations are the fairly large category to which the Central Limit Theorem (CLT) can be applied. So the limiting distribution for t-stat is already the standard normal distribution. Therefore, it seems to me that the conditions you mention for the finiteness of the first two moments of t-stat go back to those of the CLT.

For example, in the extreme if x were drawn from a Bernoulli
distribution, there would be a non-zero probability the sample
variance is zero, and thus t is infinite or not defined, and the
expectation of t does not exist.

Something like this will almost certainly not happen if the data come from Normal, and this is true for any large sample that meets the CLT assumptions.
Finally, the CLT implies convergence of the t-stat to the standard normal distribution, but, as noted in Whuber's comment, the CLT does not imply convergence of the moments. Indeed, convergence in the distribution does not generally imply convergence in the moments. This problem is a weakness of my argument. I will not solve it now; suggestions are welcome.
I can note, however, that even if convergence in the distribution does not imply convergence of moments, it is not true that convergence in the distribution implies or even suggests the absence of convergence of moments.
The problem we are talking about here may be of little relevance in practice, and I suspect that it is.
The rule “convergence in distribution do not imply convergence on moments” is useful also as warning about the fact that some moments may not exist. However, as mentioned above, the CLT is about the convergence of the t-stat with the standard normal distribution. I have a hard time finding an intuitive and concrete case where the t-stat approximates the standard normal distribution, but the mean and variance are significantly different compared to what that distribution should imply. Moreover, even if some cases are shown, they should be pathological and the main message of my proposal can remain.
