You can turn it into a string and get the size of the string.
You can divide it by ten until it's zero, counting the number of divisions it took.
You can compare it with other numbers (if it's bigger than 9 and less than 100, for example, it has two digits).
As ne555 said, how would you do it on paper? Do that. If you would write the number on the paper (so it's a string of characters, yes?) count the number of digits, then the first option I gave is what you're doing.
I could render the number on screen in a fixed-width font, measure its width, and use that and the width of a a single character to deduce how many character were in it.