The answer depends on so many unknowns. Nobody could possibly give you a definitive answer. The best anyone can do is help you figure out which things you need to know, or just make up some numbers by sheer guesswork.
The most important is how you detect power loss. The father "upstream" you can detect the power loss, the more time you have to react. The very best way, but also the most difficult in terms of circuitry, is detection of the actual AC waveform. If you have a linear power supply with access to the low voltage AC waveform, you might be able to use resistors to scale one or both sides of the transformer to a signal you can watch. If you can detect the AC peaks are over some threshold every 8.3 ms (or 10 ms if 50 Hz power), then you tell when power has been lost with only about 10 ms latency. That's the very best way, since you still have all the energy stored in the higher voltage capacitor before a 5V regulator.
If you can only sense at the 5V power, you get much less time. By then the input to the 5V regulator has already fallen to the point it can no longer keep 5V regulated.
Hypothetically, let's imagine you can't get access to monitor the AC waveform, so you detect when 5V has fallen to 4.5V. Teensy can keep its 3.3V regulated until the input drops to about 3.6V. So the voltage can drop about 0.9V from detection until you complete backing up data.
The 2 other big unknowns are how long the backup takes, and how much extra power does the SD card or other hardware consume while writing. Let's just guess the SD card adds about 100mA extra current, so the total current draw will be 200mA during most of the time backing up. And lets guess the backup process takes 50ms.
The capacitor question is i = C * dv/dt. If we treat dv and dt as delta voltage and delta time (horrific to mathematicians who love calculus but a reasonable approximation), then we just rearrage the equation to C = i * dt / dv. Plugging in i = 0.2, dt = 0.03, and dv = 0.9, the answer is C = 0.0067 farads. So it looks like the answer is you'll need a 6800 uF capacitor.... if all this guesswork is on point.
Obviously if you can sense the AC waveform, the capacitor requirement gets easier. Then you're looking at the capacitor before the 5V regulator, which presumably can drop much more than 0.9V. And it's probably already big enough to last many milliseconds, because it needs to keep the voltage up for at least the 8.3 or 10ms between AC waveform peaks.