how are these formed?
It is formed out of precipitated bile components.
Gallstone
A gallstone is a stone formed within the gallbladder out of precipitated bile components. 
where does the pancreas secrete digestive enzymes into Duodenum. what are the different diseases that affect this organ? Pancreatitis, diabetes mellitus, and pancreatic cancer. what kind of stones tend to form in this organ? Gallstones.
wiki:19847291
Gallstone [SEP] Introduction
A gallstone is a stone formed within the gallbladder out of precipitated bile components. The term cholelithiasis may refer to the presence of gallstones or to any disease caused by gallstones, and choledocholithiasis refers to presence of migrated gallstones within bile ducts. Most people with gallstones (about 80%) are asymptomatic. However, when a gallstone obstructs the bile duct and causes acute cholestasis, a reflexive smooth muscle spasm often occurs, resulting in an intense cramp-like visceral pain in the right upper part of the abdomen known as a biliary colic (or "gallbladder attack"). This happens in 1–4% of those with gallstones each year.