Hi Mary, Welcome to the forum. :)
If the door wasn't closed firmly enough, the striker (spring loaded tongue that goes into the slot) might not go fully into the hole covered by the striker plate. Sometimes you have to be a little firm with them.
If you have closed it firmly and this condition is there, then possibly a little adjustment may be needed to move the striker plate out a tiny bit.
If you hold the handle open, close the door most of the way, let go of the handle, then push the door firmly on the door by the handle, you should be able to hear a definite click as the striker engages in the slot.
If it is only barely partially latched, popping open is a likely situation.