Everyone with thyroiditis is different, so no one can say how long it might last... If you have Hashimoto's Thyroiditis, it's a life-long condition and you'll have it for the rest of your life; if it's a temporary type of thyroiditis (relatively rare), it may last a few weeks or a few months or a few years...
The first thing you have to do is visit your doctor and get tested to make sure that's what you actually have.
HIV doesn't really cause thyroiditis, but its treatments can cause hypothyroidism and/or trigger Hashimoto's, to answer your question, it would be unusual for it to happen within the first couple of months, unless you were already prone to Hashimoto's anyway...
Most cases of thyroiditis do not treat themselves; you will need medication, which must be prescribed by a doctor, to treat any resulting hypothyroidism.
There are many things that can cause symptoms that are similar to those of hypothyroidism, which I assume is what you're calling thyroiditis... Low sleep can cause fatigue, brain fog, difficulty concentrating, etc - all of which are symptoms of hypothyroidism.