While pre-flowers (in the pics above) can be an indication, it's not fool-proof.
Preflowers usually appear after 4--6 weeks, when the plant is sexually mature.
I've been growing pot for a looooong time, and I can't tell for sure until flowering begins, around late Aug. to early Sept. (in the northern hemisphere).
At this time, the males will grow "balls" (pollen sacs). They will appear all over the plant and are very noticeable. The males express sex before the females, which start to grow buds during week 3 of flowering.
Males can be processed to produce low-grade hash and/or happy butter.
Properly dried and cured, the leaves will also get you high when smoked, though not as much as buds, and it's a different type of high.