e.g. 0123 456 7890
and 01/02 prefixes are landlines, 07 are mobile phones, 08 free, and 09 premium rate lines.
Wikipedia [0] says that there are 8 digit local numbers, and 2/5 digit area codes, but I happen not to have lived in a place that uses them until mobile phones took over anyway.
[0] https://en.wikipedia.org/wiki/List_of_dialling_codes_in_the_...
But 2 or more countries can use the same country code. The area code will determine which country you call to.
In the North American numbering plan +1 all numbers must have a fixed length 3 + 3 + 4.
In many other numbering plans the length varies. Both area code length and subscriber number length can vary. So it gets pretty complicated to parse a number. Basically rules don't help, you need a database and you need to update it regularly. No idea whether an open, non-commercial data set exists.
When I call to Germany Android shows the name of pretty small places. I believe Android reports every number you call to Google. But the database is probably still local, I believe locations are also shown when you have no data connection.
I am not from the US, but I understood there you might also need extensions to be dialled after the number proper.