That safety valve lets water out for one of two reasons: the temperature gets too high or the pressure gets too high. When they get old, they sometimes also release sooner than they should. But, the most common reason for them to go off is if you don't have an expansion tank or if you do, the tank is shot and needs to be replaced. Not every installation requires an expansion tank, but all won't be hurt by one. It gives the water someplace to go when it gets heated and expands rather than making the pressure spike. It doesn't take much release to drop the pressure below the trip point.
Get yourself a $10 water pressure gauge at a big box store and check the pressure when this is happening. If you do have an expansion tank, check the pressure with a tire pressure gauge. Better yet, knock on it first and see if it sounds like it is full of water. It should be nearly empty. If you have one and it is full of water, it is probably shot. They're easy to replace, and not very expensive. If you checked the pressure, you'd probably get squirted with water.