This kind of letter is also called a “Proof of Residency Letter” or also a “Affidavit of Residency”, which is a letter to proof your residency. A Proof of residency can be required in several occasions, to register for state or national programs, visas, schools, etc, and can be written also on behalf of somebody else (e.g. you Landlord).
Stating that somebody lives with you requires also to disclose personal information, like your full name, address and the length of residency (at that address), the contract to purchase the property or even the lease agreement. While a simple utility bill (water, electricity, etc.) with your name on it could be enough in some occasion, the signature/reference of the landlord or of a notary public (e.g. lawyer) could be required in most complex situations.