JPEG, every time. This is the one part of the Threads photo downloader that surprises people, so it is worth explaining properly.
Threads stores uploaded photos as HEIC, and the URLs in a post's metadata still end in .heic. But those URLs also carry a conversion instruction, and Meta's CDN converts on the way out — what actually arrives over the wire is a JPEG. So the file is named .jpg, because that is what the bytes are.
As a backstop, the download proxy also checks the Content-Type of the response and names the file from that. If Meta ever changes how the conversion is signalled, you still get an extension that matches the contents rather than an unopenable .heic.