An Exocrine gland is distinguished by the fact that it excretes its essential product by way of a duct to some environment external to itself, be it either inside the body or on a surface of the body.
Examples of exocrine glands include the sweat glands, salivary glands, mammary glands, pancreas and liver.
An Endocrine gland is its counterpart. It secretes its essential product without the use of a duct directly into the bloodstream or else by diffusion into its surrounding tissue (paracrine signaling) where it often affects only target cells near the release site.
Examples of endocrine glands include the adrenal glands, located atop the kidneys and responsible for the secretion of certain hormones such as adrenaline, cortisol and others. The testes, sing: testicle, in males and ovaries in females are not only gonads, organs which generate male and female germ cells respectively, but are also endocrine glands in that they produce various androgens and estrogens together known as steroidal sex hormones.
Read more about Exocrine Gland: Structure, Method of Secretion, Product Secreted, List of Exocrine Glands