It depends how hard they hit their head.
Sometimes the bump pops up within a few minutes. Sometimes it gradually comes on over the next few hours. Applying ice and pressure would help prevent the swelling, but most toddlers hate the ice. The bump is caused by blood and fluid building up under the skin. It can last several weeks.