Long qubit coherence and efficient atom-photon coupling are essential for advanced applications in quantum communication. One technique to maintain coherence is dynamical decoupling, where a periodic sequence of refocusing pulses is employed to reduce the interaction of the system with the environment. We experimentally study the implementation of dynamical decoupling on an optically-trapped, spin-polarized 87 Rb atom. We use the two magnetic-sensitive 5S 1/2 Zeeman levels, |F = 2, mF = −2 and |F = 1, mF = −1 as qubit states, motivated by the possibility to couple |F = 2, mF = −2 to 5P 3/2 the excited state |F ′ = 3, m ′ F = −3 via a closed optical transition. With more refocusing pulses in the dynamical decoupling technique, we manage to extend the coherence time from 38(3) µs to more than two milliseconds. We also observe a strong correlation between the motional states of the atom and the qubit coherence after the refocusing, which can be used as a measurement basis to resolve trapping parameters.