Reliable encoding of information in quantum systems is crucial to all approaches to quantum information processing or communication. This applies in particular to photons used in linear optics quantum computing, which is scalable provided a deterministic single-photon emission and preparation is available. Here, we show that narrowband photons deterministically emitted from an atom-cavity system fulfil these requirements. Within their 500 ns coherence time, we demonstrate a subdivision into d time bins of various amplitudes and phases, which we use for encoding arbitrary qu-d-its. The latter is done deterministically with a fidelity >95% for qubits, verified using a newly developed time-resolved quantum-homodyne method.