Some people may use this term interchangeably, but it should be remembered that denim is known to be the type of fabric that you will use so that jeans can be made. The fabric is usually made out of cotton and is known to be comfortable, although some types of cloth that may claim to be denim may not be as comfortable as expected. Jeans can also be used to describe any pants or trousers.
It does not necessarily have to be made of denim. Some jeans are made of linen while there are also others that are made of silk. Denim jeans have started to become popular in the 80s but became popular in the 90s. This is still considered to be a closet staple right now.