The maximum number is one more than the maximum genus of a curve of degree m, attained when the curve is nonsingular. Moreover, any number of components in this range of possible values can be attained.
A curve which attains the maximum number of real components is called an M-curve (from "maximum") – for example, an elliptic curve with two components, such as or the Trott curve, a quartic with four components, are examples of M-curves.
Dmitrii Andreevich Gudkov, The topology of real projective algebraic varieties, Uspekhi Mat. Nauk 29 (1974), 3–79 (Russian), English transl., Russian Math. Surveys 29:4 (1974), 1–79