how i know the number of digits in each number

Count them.

246 has 3 digits

1,677,439 has 7 digits