Manipulation of photonic quantum states: From generation, engineering, and characterization to storage and retrieval