You cannot secure fence hinges to brick with simple screws and expect them to hold. In fact, you will likely never get the screws to stay in the bricks. The best way to secure a fence gate to a brick wall is by installing anchor bolts, using a hammer drill equipped with a masonry bit. If you don't own a hammer drill, you can rent one from a home equipment rental facility.
Place the gate against the brick wall in the closed position. Have a friend or family member help you hold the gate while you place a bubble level on the front of it. Position the gate so it stands fairly plumb, then swing the gate to the open position. Mark the mounting holes on the hinges onto the wall, using the felt-tip marker. Set the gate aside.
Drill holes through the brick, using the marker spots as locators. The size of drill bit and the depth to drill depend on the size of wall anchor you use. Use masonry wall anchors designed for use in concrete and brick. Drill the hole deep enough to seat the entire anchor into the brick.
Place the hinges against the wall and align them with the holes. Again, have your helper hold the gate in place.
Thread the screws into the anchors with your fingers and tighten with the screwdriver. (If you are using hex-headed screws, use a socket and ratchet to tighten the screws.) As you tighten the screws, prongs built into the anchors dig into the brick for a secure hold.
Purchase wall anchors at a hardware store or home improvement centre.
Always wear protective eyewear when using power tools.