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).

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)

