Tenants in the US have real rights, whatever their immigration status. Most tenant law is made by states and cities, so details differ a lot. This differs by state; see In your state below. Here is the general picture.
In most states, landlords must keep a rental habitable: safe and fit to live in. That usually means working heat, plumbing, hot water and electricity; no serious leaks; locks on doors; protection from pests; and following building and safety codes.
How to ask for repairs:
Report the problem in writing (portal, email or letter). Keep a copy.
Give the landlord a reasonable time. Urgent problems (no heat in winter, no water, sewage) should be faster.
If nothing happens, contact your city's code enforcement or housing inspection office. They can inspect and order repairs.
Do not stop paying rent on your own. Some states allow withholding rent or "repair and deduct", but only by strict steps. Ask a local tenant organization or legal aid first.
Landlords usually must give notice (often 24 hours or more) before entering, except in emergencies. Your lease and state law set the rules.
Eviction only through court
A landlord who wants you out must usually give written notice and then win an eviction case in court. In general, a landlord may not lock you out, remove your things or turn off utilities to force you out. If you receive court papers, do not ignore them: go to the hearing, and contact legal aid (free lawyers for people with low income).
Many states forbid landlords from punishing you (raising rent, eviction) because you asked for repairs or complained to an inspector.
The federal Fair Housing Act forbids housing discrimination because of race, color, national origin, religion, sex, familial status (having children under 18, or being pregnant) or disability. Many states and cities add more groups.
Examples that may be illegal: "We don't rent to people with accents", higher deposits only for immigrants, refusing families with children, refusing a reasonable change for a disability, such as an assistance animal.
How to complain:
Write down what happened, dates, names, and save messages and ads.
File with HUD online at hud.gov (search "file a fair housing complaint"), or call 1-800-669-9777. Filing is free.
File within one year of the discrimination.
You may also contact a local fair housing organization for help.
Your rights to repairs and to fair treatment do not depend on your visa. A landlord threatening to "call immigration" to stop you from asking for repairs is a sign to get help from a legal aid or tenant organization.
Look for your state attorney general's tenant guide, your city's housing department, or a local tenant union for rules on deposits, notice, rent increases and rent control.