Violations of a Bell inequality are reported for an experiment where one of two entangled qubits is stored in a collective atomic memory for a user-defined time delay. The atomic qubit is found to preserve the violation of a Bell inequality for storage times up to 21 microseconds, 700 times longer than the duration of the excitation pulse that creates the entanglement. To address the question of the security of entanglement-based cryptography implemented with this system, an investigation of the Bell violation as a function of the cross-correlation between the generated nonclassical fields is reported, with saturation of the violation close to the maximum value allowed by quantum mechanics.