I found the Tilemill/Mapbox documentation a little tough to navigate for beginners as well. Having just figured this out, a few clarifications:
a) Start with the mapbox/tilemill guide to styling labels. LINK Note that you call the desired table (layer) with the # (for example #roads). Use the layers button to find which column in the table contains the road names (for example 'ROAD_NAME'). You'll then use that column info to create labels like so:
#roads {
**text-name: [ROAD_NAME];**
text-size: 16;
text-fill: #fff;
}
b) To get the effect you reference in the first attached image, you'll probably want to align your labels to the road lines (follow the same tutorial link above).
#roads {
text-name: [ROAD_NAME];
text-size: 16;
text-fill: #fff;
**text-placement: line;**
}
c) Sometimes you want to get more specific with what you're styling. A common example: road types defined as residential, motorway, highway or bikepath in a column called ROAD_TYPE.
#roads [ROAD_TYPE = "motorway"] {
text-name: [ROAD_NAME];
text-size: 16;
text-fill: #fff;
text-placement: line;
}
The style mark-up between the {} will only apply to roads of ROAD_TYPE "motorway".
d) Finally, the tutorial on Advanced Label Placement should help with further issues once you're comfortable with the basics. LINK
Hope it helps!