  Gravitational waves are expected to be produced from neutron star
oscillations associated with magnetar giant flares and short bursts. We present
the results of a search for short-duration (milliseconds to seconds) and
long-duration ($\sim$ 100 s) transient gravitational waves from 13 magnetar
short bursts observed during Advanced LIGO, Advanced Virgo and KAGRA's third
observation run. These 13 bursts come from two magnetars, SGR 1935$+$2154 and
Swift J1818.0$-$1607. We also include three other electromagnetic burst events
detected by Fermi GBM which were identified as likely coming from one or more
magnetars, but they have no association with a known magnetar. No magnetar
giant flares were detected during the analysis period. We find no evidence of
gravitational waves associated with any of these 16 bursts. We place upper
bounds on the root-sum-square of the integrated gravitational-wave strain that
reach $2.2 \times 10^{-23}$ $/\sqrt{\text{Hz}}$ at 100 Hz for the
short-duration search and $8.7 \times 10^{-23}$ $/\sqrt{\text{Hz}}$ at $450$ Hz
for the long-duration search, given a detection efficiency of 50%. For a
ringdown signal at 1590 Hz targeted by the short-duration search the limit is
set to $1.8 \times 10^{-22}$ $/\sqrt{\text{Hz}}$. Using the estimated distance
to each magnetar, we derive upper bounds on the emitted gravitational-wave
energy of $3.2 \times 10^{43}$ erg ($7.3 \times 10^{43}$ erg) for SGR
1935$+$2154 and $8.2 \times 10^{42}$ erg ($2.8 \times 10^{43}$ erg) for Swift
J1818.0$-$1607, for the short-duration (long-duration) search. Assuming
isotropic emission of electromagnetic radiation of the burst fluences, we
constrain the ratio of gravitational-wave energy to electromagnetic energy for
bursts from SGR 1935$+$2154 with available fluence information. The lowest of
these ratios is $3 \times 10^3$.
