They aren't open all day, in fact they usually aren't even open all afternoon. Given the lack of turnover at the tables I have often wondered how they make any money, but that's not the point, I guess. A friend of mine who lives in Turino told me they make money even without the turnover because the profit margin on restaurant food is so high. I guess she's right. They all serve food but the sorts of food they serve depends on the type of place they are.
Restaurants are the fanciest and have the highest prices generally.
You get the normal Roman fare in the standard Italian way. Trattorias are restaurants that are generally owned by family members. You can get a good meal with a decent menu choice at a trattoria. You get really good food at an osteria. A pizzeria is obvious.