Vitamin B2 refers to the molecule known as riboflavin, which is a vitamin because it can produce two cofactors abbreviated as FAD and FMN. Some proteins in the body are dependent on these cofactors to function optimally and dietary riboflavin is the sole provider of FAD and FMN for these enzymes, which are called flavoproteins since FAD and FMN are 'flavins' and work in concert with these proteins.
True deficiencies of riboflavin result in a condition known as ariboflavinosis, which is fairly rare in first world countries but characterized by various ailments of mucuous membranes (mouth and throat) and the skin as well as eye problems. Suboptimal deficiencies are somewhat prevalent although not common aside from a few groups, and for the most part do not result in any major health-threatening conditions.
Groups that would benefit from riboflavin supplementation include adolescent and young adult women, particularly in the UK where riboflavin is not fortified in food to as high a level as in the US and Canada, and the elderly which tend to have less than optimal intakes of riboflavin.
Beyond merely supporting a good riboflavin status, supplementation has a possible benefit for cardiovascular health in a certain population. People who have two copies of a certain gene, known as MTHFR 677TT, have a condition where homocysteine is abnormally elevated due to defects in folate metabolism. These people may experience reductions in blood pressure and homocysteine when riboflavin is supplemented at a low dose. Higher doses of riboflavin (at around 400mg taken in split doses throughout the day) may also have a therapeutic effect for migraines.
Overall, riboflavin is a vitamin which someone could not ingest enough of if their diet is poor, yet a better diet could correct this. Supplementation is never mandatory but is likely prudent for people who are confirmed to be MTHFR 677TT or for anemics on iron repletion therapy (where optimizing riboflavin intake would aid the utility of supplemental iron).