The first of which is a simple guest appearance from one character into another comic book. Very popular characters like Batman, Superman, Spider-Man, and Wolverine are often the most used for this. Publishers would often use these characters to inject interest into the other comic, sometimes even to boost sales.
Another type of crossover is one that can bring a lot of joy to comic fans and this is when characters from different publishers make appearances in each others comic books. A nice example of this was when we finally got to see JLA VS Avengers, a book that was decades in the making. Fans were very excited to finally see this comic come together and with George Perez at the helm in the art department.
One of the more infamous kinds of crossovers is when a company tells a story over most if not all of their entire line of comic books. These are often referred to as "events" and get a lot of hype from the publisher. Marvel Comics became quite known for their crossovers, especially during the nineties, but many fans cried foul as they thought it was more of a sales strategy than a storytelling aide. Marvel did many crossovers until until fans cried out and the practice was put away for awhile.
Whether you like or dislike the concept of the crossover, it is a practice that is still quite commonly used in the comic book world. Whether you think it is great or a gimmick is still up for debate and you can only vote with your wallet.