Quantum fluctuation of the energy is studied for an ultracold gas of interacting fermions trapped in a three-dimensional potential. Periodic-orbit theory is explored, and energy fluctuations are studied versus the particle number for generic regular and chaotic systems, as well as for a system defined by a harmonic confinement potential. Temperature effects on the energy fluctuations are investigated.