A hoarseness persisting beyond two weeks needs an evaluation by an ENT specialist. It could be due to varied causes like
upper respiratory tract
infection like laryngitis or pharyingitis, head and neck cancer, oral cancer, reflux laryngitis in people who have acidity and GERD, muscle abnormality, voice box abnormality, polyps, tumors or weakness of voice box etc.
Hope this helps. Please let me know if there is any thing else and do keep me posted. Take care!