The power flag is in the power lib.
It tells kicad that a net is powered by being a single pin device (pin is of type power output) So place this carefully to still get the benefit of the ERC.
Directly at the connector that powers your pcb. If you have a passive device in series (Fuse, inductor of a filter, …) then after this device (But again as close as possible to it.)
You might want to take a look at this FAQ article: Electrical type of schematic symbol pins (KiCad 4 and KiCad 5)
Especially the section about power input/output pins.