When you turn into a Genin you can ask an Admin or your Kage to give you the element test,
The Admin or Kage will give you a piece of paper and will tell you to focus your chakra on it,
These are the following possible results,
Your paper crumbles away - Earth
Your paper sets on fire - Fire
Your paper gets wet - Water
Your paper crunches - Lightning
Your paper splits into pieces - Wind
When you are a Genin you can only have one element,
Chuunins can have two and Jounins can have four,
Kage's and other S-ranked people can have all five.