I have an outdoor light that is run by a regular wall switch. I want to change this to a mechanical timer switch. The mechanical timer switch has two ports for wires. When I opened the wall switch I found three black wires: one in each of the push in ports and one under a side screw. How do I wire in the mechanical switch that has two ports when I have three black wires attached to the old regular wall switch?
Sometimes receptacles and switches are used to join two wires together out of convenience. What you have is a regular switch with two terminals, but the electrician has used a push terminal and a screw terminal to join two hot (black) wires. The push terminal and screw terminal next to it are the same electrical connection.
Lets say the top of the switch has a black wire on the screw and one in the push terminal and the bottom of the switch just has one wire in the push terminal... To hook up the new switch, you're going to pigtail the top two wires to one terminal on the timer. That means connecting the two black wires and a new short length of black wire with a wire nut and then connecting that short wire to the switch. The wire currently going to the bottom of your switch will just get connected to the other terminal on the timer.
OK, you've got a hot,black, wire coming from a breaker into the switch. From there another black wire is connected to almost the same location of the switch, probably using a backstab, making that wire hot to go to another location. Those two wires should be wire nutted together with a 6" piece of appropriately sized wire and connected to the line side of the switch. The black wire at the opposite end of the switch is the load wire going to the outdoor light and should be connected to the load side of the switch. If line and load terminals are not indicated, then either terminal can be used for your feed or light wire.
As always, remember to turn off the power when doing any of this work and if you have a voltage tester or meter, verify the hot wires.