How do I find if a programming language is infinite or finite?
An infinite number of potential identifiers results in an infinite language, but this is a "boring" feature with this consequence, because you can do without. We know that two variables are sufficient to compute any Turing computable function, so this is not the crucial part; I'll assume we use only finitely many variables.

Even then, ignoring real-world constraints such as finite memory, programming languages are -- of course -- infinite languages. Consider the following class of programs:

def m(x) {
  x++
  x++
  ...
  x++
  return x
}


It is clear that you can have as many statements as you want (never mind that, depending on the semantics, it might be that only finitely many of them run without error).

Why do I say "of course"? Well, usually programming languages are supposed to be Turing complete (again, assuming infinite memory). There are infinitely many functions that are Turing computable -- consider only $f_i(x) = i$ for $i \in \mathbb{N}$ -- so we must have infinitely many programs.

It is even so that typical programming languages have infinitely many programs for any single (computable) function! Consider, for instance, $f_1$ and all implementations of the form

def f1(x) {
  x++
  x++
  ...
  x++
  return 1
}


If you think about it, you can do stuff like that -- inserting "meaningless" statements -- in any program written in any language.