There are approximately 25 grains of wheat in a gram. Depending on the variety of wheat and the particular plant, 1,000 grains of wheat weigh between 30 and 50 grams, averaging around 40 grams. Dividing 1,000 by 40 gives the average number of grains in 1 gram.
A "grain" is a unit of measurement going back to the Middle Ages that was originally based on the weight of a grain of barley. There are 15 grains in a gram because the average barley grain is bigger than a wheat grain. Grains of wheat are also called wheat kernels or berries.