Historical origin of commas and periods in numbers
Decimal fractions
The history of notation for decimals is discussed in detail in Cajori, A History of Mathematical Notations, Volume I (1928), starting from section 276. Here is my attempt at summarizing.
Cajori attributes the invention of decimal fractions to Simon Stevin's La Disme (1585), but early writers used a bewildering variety of notations. There was 693② for our $6.93$, or $\overset{(1)}{6} \overset{(2)}{6} \overset{(3)}{6} \overset{(4)}{7}$ for our $0.6667$, or $393|75$ for our $393.75$, or $23027\overset{\circ}{0}022$ for our $230270.022$, or $5^{\underline{9321}}$ for our $5.9321$. The catalogue of examples goes on and on. John Napier's Rabdologia (1617) introduced the dot and comma as decimal separators. (Napier used both.) But the dot and comma were just two notations among many. The vast assortment of notations continued through the 1600s.
Gradually, in the 1700s, the standards proliferation crisis was largely averted the comma and dot became the most popular, although other notations continued to be found. But a conflicting factor was that Leibniz had proposed the dot for multiplication in 1698. This was popularized throughout continental Europe (which is a whole other story). So, in the 1700s, the comma was more popular than the dot as the decimal separator in Germany, France, and Spain. (In Belgium and Italy, it took much longer for the comma to prevail.) England generally preferred $\times$ for multiplication. The dot as the decimal separator became standard in England in the 1800s.
There were still notational variations, particularly as to the vertical positioning: $2.5$, $2 \! \cdot \! 5$, $2, \! 5$, $2 \text{'} 5$, $2`5$, $2_{,5}$, $2_{.5}$. And the vertical positioning could have different meanings. In England the convention was that $2 \! \cdot \! 5 = \frac{5}{2}$ and $2.5 = 10$. In the United States, the dot as the decimal separator became standard by about 1850, and by the late 1800s the convention developed that $2.5 = \frac{5}{2}$ and $2 \cdot 5 = 10$, the opposite of England.
The overall lack of agreement remained by the time of Cajori's book (1928), and disagreements continue to the present day.
Digit grouping
Cajori also covers digit grouping (section 91), but he is apparently not as interested in this topic, since the section is much shorter and is only a list of examples. Again, the list has a great deal of variety, such as $\dot{\dot{\dot{8}}}678\dot{\dot{9}}32\dot{5}178$ and $86\!\cdot\!789\!\cdot\!3\!\cdot\!25\!\cdot\!178$ and others, some of which are beyond my already-strained knowledge of TeX. Today, of course, there are many conventions in use around the world, and not just 1,111,111, 1.111.111, or 1 111 111 - more can be found on this list of examples in Wikipedia.
My attempt of translating some German articles for you...
The use of a decimal separator developed from the use of place value systems that were introduced by the Sumerians in the 18th century BC. From the resulting possible fractions, the separation of the whole number part from the fractional part of a number developed. When using the decimal notation, the denominator was omitted over time and the fractional part was separated from the integer by different notations. In addition to the decimal separator, there is also the thousands separator, which improves the readability of large numbers by grouping the digits into groups of three. However, mathematically speaking, they are not decimal separators.
In old Chinese mathematics (e.g. Li Jan), the fractional part was identified by subscripted numbers, for example {\ displaystyle 123_ {45}} {\ displaystyle 123_ {45}} for 123.45. Around 1400, Jamshid Masʿud al-Kashi wrote the whole number part in black ink and the broken part in red ink. The first known source for the use of a decimal point is then the "Compendio del Abaco" (1492) by Francesco Pellos, an Italian mathematician. So, based on this example, he simply wrote 123.45. Furthermore, different methods of representation are used for decimal numbers with fractions, for example François Viète (France) used different notations in the Canon in 1579, using the comma as a thousand separator:
{\ displaystyle 12 {,} 345 {,} {\ frac {678 {,} 901} {1 {,} 000 {,} 000}} \ quad 12 {,} 345 {,} {\ frac {678 {, } 901} {,}} \ quad 12 {,} 345 {,} _ {678 {,} 901} \ quad 12 {,} 345 \ vert _ {678 {,} 901}} for 12,345,678,901 with a decimal point between 5 and 6
In 1593, Christophorus Clavius used the point as a decimal separator in sinus tables and in 1595, Bartholomäus Pitiscus in his "Trigonometria". In 1617, John Napier first used the decimal separator in the Rhabdologia, followed by the period, especially in his logarithmic tables, which were widely used. In the following years and decades, the decimal point was mainly used in textbooks and among financial and scientific experts, from Johannes Kepler to Henry Briggs, Adriaan Vlacq (1600–1667) and Jérôme Lalande (1805).
In the 18th century, however, the decimal point increasingly appeared in everyday use and teaching in continental Europe. It found its way into popular science books. The decimal point can also be found in Joseph-Louis Lagrange (1808) and in the German translation of the Introductio in Analysin Infinitorum by Leonhard Euler, made by H. Maser in 1885. In Meyers Konversations-Lexikon (1888–1890, 4th edition) there is a notation with the comma as a thousand separator and as a decimal separator, the fractional part of the number is set smaller.
In the English-speaking world, the point remains the predominant decimal separator. The word decimal point is mentioned in 1771 in the Encyclopædia Britannica in the chapter "Arithmetick".
In the countries where the decimal point is used (English-American influence (e.g. Commonwealth)), a space is often used as a grouping symbol. If the decimal point is used, the comma is often used as a thousand separator. In 1798, during the French Revolution, Auguste-Savinien Leblond recommended the semicolon (;) as a decimal separator so that the comma could be used as a thousand separator.
Today, the world is roughly devided into point (USA, GB, India, Australia, etc.), comma (Germany, France, Italy, Russia, Spain, most of Africa, etc.) and Momayyez (Iran, Saudi Arabia, Jemen, etc.). Switzerland is the only country where both ways are widely used and accepted.
According to international standards (SI and ISO), both comma and point are correct with a slight tendency towards the comma in recent times.