https://en.m.wikipedia.org/wiki/613_commandments
from that article
Rabbinic support for the number of commandments being 613 is not without dissent and, even as the number gained acceptance, difficulties arose in elucidating the list. Some rabbis declared that this count was not an authentic tradition, or that it was not logically possible to come up with a systematic count. No early work of*Jewish law*or Biblical commentary depended on the 613 system, and no early systems of*Jewish principles of faith*made acceptance of this*Aggadah(non-legal Talmudic statement) normative. The classical*Biblical commentator*and grammarian Rabbi*Abraham ibn Ezra*denied that this was an authentic rabbinic tradition. Ibn Ezra writes "Some sages enumerate 613 mitzvot in many diverse ways [...] but in truth there is no end to the number of mitzvot [...] and if we were to count only the root principles [...] the number of mitzvot would not reach 613" (Yesod Mora, Chapter 2).
Nahmanides*held that this particular counting was a matter of rabbinic*controversy, and that rabbinic opinion on this is not unanimous. Nonetheless, he concedes that "this total has proliferated throughout the aggadic literature... we ought to say that it was a tradition from Moses at*Mount Sinai" (Nahmanides, Commentary to Maimonides'*Sefer Hamitzvot'', Root Principle 1).
Rabbi*Simeon ben Zemah Duranlikewise rejected the dogma of the 613 as being the sum of the Law, saying that "perhaps the agreement that the number of mitzvot is 613... is just Rabbi Simlai's opinion, following his own explication of the mitzvot. And we need not rely on his explication when we come to determine [and affect] the Law, but rather on the Talmudic discussions" (Zohar Harakia, Lviv, 1858, p.*99).
Even when rabbis attempted to compile a list of the 613 commandments, they were faced with a number of difficulties:
Which statements were to be included amongst the 613 commandments? Every one of God's commands to any individual or to the entire people of Israel?
Would an order from God be counted as a commandment, for the purposes of such a list, if it could only be complied with in one place and time? Else, would such an order only count as a commandment if it could be followed at all times? (The latter is the view of*Maimonides.)
Does counting a single commandment depend on whether it falls within one verse, even though it may contain multiple prohibitions, or should each prohibition count as a single commandment?
Ultimately, though, the concept of 613 commandments has become accepted as normative amongst practicing Jews and today it is still common practice to refer to the total system of commandments within the Torah as the "613 commandments", even among those who do not literally accept this count as accurate.