Class work often includes collaborating and presenting some or all of your work with others. When working with a partner or in a group, it can be difficult to know how much to contribute on your own and how much to rely on the work of others. Besides knowing you should be doing both these things to some degree it might not be obvious what balance to strike.
For lab classes you will often be paired with another person, your lab partner. The work you do in the lab, such as an experiment for a chemistry class, will be done in collaboration with this person. It is expected in the lab setting that you will share the work more or less equally. However, there is often associated work that you are expected to do on your own. For example, you may have to write up a summary of your experiment in your lab notebook to show that you, as an individual, understand the steps taken and the results of your experiment.
Getting help on an individual assignment from a friend, classmate, or someone else you know can sometimes be tricky to navigate in terms what is or is not permissible. In almost all situations your professors encourage the idea of conversing with people outside the classroom for the purpose of sharing thoughts and ideas. However, it can be difficult to know when a conversation crosses the line into being too much assistance. One way to think about this is to think about the sources you would cite when writing your paper. If you should be citing one of your friends for an idea included in your paper then you likely received too much help from your friend.
Exams require you to do your own individual work, even though you may study beforehand in groups, unless your professor specifically tells you otherwise. This includes take-home exams as well as exams in the classroom. If there are aspects of the exam that are unclear, this is one time when you should specifically direct questions to your professor rather than ask a friend or classmate.