Following are the main United States government offices relating to US immigration matters.

DOS (Department of State) – This agency deals primarily with issuance of visas, both immigrant and non immigrant.

DHS (Department of Homeland Security)

The USCIS deals with the approval of various visa petitions both immigrant and non immigrant. Once the petition is approved, in most cases a visa has to be applied for at the US Consulate or Embassy abroad. The CBP is entrusted with safeguarding the US borders. Even if a person has a valid visa, he or she can still be denied entry into the US if the CBP officer at the port of entry is not satisfied with the bonafides of the applicant.

DOJ (Department of Justice) – This agency mainly deals with the appeals in immigration matters.

DOL (Department of Labor) – As the name suggests, this agency deals with various labor law issues.

IRS (Internal Revenue Service)
Finally, this is Uncle Sam who gets a cut (tax) of all that you earn in the US and for US citizens and permanent residents, a cut from your worldwide income.