I defer to Eric Shain's excellent answer about how to obtain the numbers from Google Patents. I will therefore limit myself to a comparison of different countries.
Broadly, every country follows the same process:
Application → (Application) Publication → Grant (Publication)
Typically, "publication" refers to the application publication, and "grant" refers to the grant publication. "Patent number" always refers to the grant publication, since the application number and the application publication do not relate to a patent (that is, a granted patent), but only to a patent application.
Every country has a number to refer to each of these. Rarely the application publication is skipped (if the grant occurs quickly). And the grant publication may not be available (if it hasn't been granted).
Publication numbers (whether in the application stage or the grant stage) comprise three parts: a country code, a number, and a kind code. The country code and number are obvious. In the kind code, an "A" always denotes an application publication, and a "B" always denotes a grant publication. The relevance of any numbers in the kind code (such as the difference between A1 and A2) vary from country to country.
An application publication number and a grant publication number may be the same (such as with EP applications), since the kind code uniquely distinguishes them. They may also be different (such as with US applications). This is country-specific.
Applications don't have a kind code, since an application isn't a publication per se.
The formats of each of the numbers differs from country-to-country.
A US application, publication and grant each get different numbers.
Application: US 12/343233
Publication: US 2009/0246777 A1
Grant: US 8093020 B2
At the EPO, the publication number and grant number differ only by the kind code.
Application: EP 95936210.4
Publication: EP 0783694 A1
Grant: EP 0783694 B1
For a PCT application, the application number includes the country of the receiving office of the application (because actually the number is assigned by the receiving office, so this avoids the need to sync numbers between receiving offices). But it is still a PCT application regardless.
Publication: WO 2009/086415 A1
Grant: None, PCT applications are never granted.
At SIPO, the publication number and grant number differ only by the kind code. China changed its numbering system in 2010. The EPO provides an overview.
Application: CN 201080059371.7
Publication: CN 102656458 A
Grant: CN 102656458 B
Japan unhelpfully uses the same format for application and publication numbers, but with different numbers. This leads to no end of confusion.
Japan also changed its format in 2000. Before then, the publication number actually changed after it was examined (but before it was granted). The EPO provides an overview.
Application: JP 2015-245934
Publication: JP 2016-119900 A
Grant: JP 6141396 B2