Citing Muller et al’s, (1955) work on electronic displays, Eastman Kodak’s (1983) Ergonomics Design for People at Work states that people can discriminate 24 different absolute angles of inclination under optimum viewing conditions. This implies that an angle of 360/24 = 15 degrees can be readily classified as inclined rather than flat.
However, I’d say 15 degrees is probably overly conservative. It applies to discriminating one arbitrary angle of inclination from another when each is shown in isolation. Discriminating flat (0 degrees) from inclined is apparently a special case that is easier to do, as indicated by the study cited by Josh where people quickly detected inclinations as small as 0.5 degrees.
Assuming you’re talking about imagery you create in the built environment (e.g., for an information display), there are often vertical and horizontal references to compare the line to (e.g., the edges of a page, the bezel of a monitor, the doorway to a room). In fact, the presence of such references probably defines what “flat” means (e.g., people will still call your first line above “flat” even if they cock their head a bit to look, or even if their respective tablets/laptops are in their laps and not completely level). So, in a built environment (and outside a field-dependence laboratory), detecting an inclined line often has a degree of relative discrimination that I expect helps a lot. As for detecting inclinations in the natural world, well, there’s a reason carpenters use levels.
If you’re building an information display (e.g., a graph), you can go to smaller angles by adding reference marks, as shown below.
This changes the viewers’ task from recognizing an inclination to recognizing vertical gap size. People can spot a gap as small as few arc-minutes of visual angle.
Muller PF Jr, Sidorsky RC, Slivinski AJ, Alluisi EA, & Fitts PM
(1955). The symbolic coding of information on cathode ray tubes and
similar displays Technical Report 55-375. Wright Air Development Center, Wright-Patterson AFB, October.
Eastman Kodak Company (1983). Ergonomic design for people at work. New York: Van Norstrand.(link)