The process that creates sperm or egg cells