There is a distinction between gangster movies and crime films more generally, to the extent that the former is more of a sub-genre that exists within the latter (the main genre). Or, less confusingly ...
You can go back pretty far in time to find releases that support the idea of gangster movies having been pretty much always popular, to some extent. There was Dr. Mabuse, the Gambler in the silent era ...