Carbohydrates, or carbs, include as the most prominent examples sugar, and starch (which is found in bread, pasta, potatoes, etc.). Carbs are a type of fuel for the body; their nutritional purpose is to provide calories.
Among the macronutrients, carbs are unique in that no kind of carbohydrate is an essential nutrient. According to current scientific consensus, the minimum level of carbohydrate intake necessary for health is zero. However, almost all people's diets include carbohydrates. Consuming a diet containing very little or no carbs will induce a metabolic state called ketosis, and such a diet is called a ketogenic diet.
Most people derive 40% to 70% of their calories from carbohydrates. Carbohydrates contain 4 calories per gram. (The quantity varies depending on the type of carb; but the variance is small.) So if a person ate a 2,000-calorie diet and derived 60% of their calories from carbs, they would be eating (2000*.60)/4 = 300 grams of carbs per day. If one is eating a ketogenic diet, which is to say one hopes to enter the metabolic state of ketosis, it is considered necessary to eat less than 100g of carbs per day, and prudent to eat less than 50g.
Just as there is no minimum safe level of carbohydrate intake, there is also no maximum safe level, provided that one is not getting too many calories, and that one is getting sufficient amounts of the other calorific nutrients (namely protein and fat). One cannot get 100% of one's calories from carbs simply because protein and fat also contain calories, and unlike carbs they are essential nutrients.
Carbs vary in how quickly they are released into the bloodstream, which is measured by the "glycemic index (GI)." GI is essentially a matter of how quickly the carb can be digested. High GI carbs are digested and released into the bloodstream quickly, and low GI carbs are digested and released slowly. Sugar is a high GI carb, and starch is a low GI carb.
Low GI carbs are considered more healthful than high GI carbs. High GI carbs lead to a "blood sugar spike," which forces the body to store some of the carbohydrate in the blood, possibly storing it as fat and causing weight gain. High GI carbs can create the phenomenon of a "sugar rush" (a peak in energy) followed a "crash" (a period of low energy after the carb is gone from the blood). High GI carbs may make a person hungry again more quickly, which may in the end result in the person eating more calories than they need. For these reasons, it is good nutritional practice for one's carbs to be predominantly low GI carbs.