This is a question of style, and, if you are writing
in a structured environment (e.g., school or work),
you should follow whatever standards and guidelines
are in effect in your situation.
But, as one somewhat official example,
the U.S. Government Printing Office (GPO) Style Manual (a 467-page PDF)
says, in Chapter 12. Numerals, section 12.14 Punctuation (page 289)
The comma is used in a number containing four or more digits,
except in serial numbers, common and decimal fractions, astronomical
and military time, and kilocycles and meters of not more
than four figures pertaining to radio.
although in preceding paragraphs they have indicated
that commas should not be used in years (e.g., 2017).
Section 12.7 indicates that street addresses (e.g., “1727 St. Clair Avenue”)
and telephone numbers are considered to be serial numbers
(and thus should not have commas —
presumably, even if they have more than four digits
(and, yes, I know of a place where they have five-digit street numbers)).
It goes without saying that this also applies to postal ZIP codes.
Oddly, they say that “a 1,100-percent increase”
and “an 1100-percent increase” are both acceptable.
They don’t explain; I guess the rationale is that
“1,100” would be pronounced “one thousand one hundred”
and “1100” would be pronounced “eleven hundred”.
And (again, without any explanation) they offer
“Dow Jones average of 10500.76” as an example of correct usage.