The Gate is a digital component that is used to compute an output for certain inputs, the inputs and outputs have two states high-1 and low- 0. Let us assume high is 5V and low is 0V (like in CMOS). On a high level the LED will light up and on a low level the LED is off. Now let us see what Logic means. digital-tutors - project page.
Gates are what make many of ICs, the two popular families are the 40xx CMOS and the 74xx TTL . Now 40xx come in 74HCT40xx flavors which approach the quality of an ideal gate. Entire circuits with Gates can also be also be burnt into PLDs, FPGAs and CPLDs just like you burn your CDROM. Gates can also be implemented in assembly language which a microcontroller like 8051 will understand and execute.
Hardware gate circuit will operate in real time, nano seconds delay will be there due to propagation delay, gate capacitance and FET switching times etc. Software or microcontroller gates code working will depend on both propagation delay and the CPU clock speed.
Gates can be combined to make combinational or sequential logic circuits. combinational circuits are a complex network of gates interconnected to evaluate a pattern of output for patterns of input. Sequential circuits use memory elements hence output patterns depend both on input patterns and the memory of history of events. An example of combinational logic circuit is a seven segment display decoder CD4511 and and example for a sequential logic circuit is CD4029 up-down counter.
The CD40xx CMOS family can work at even 3V-9V-12V DC and consume low power. The speed is not as fast as 74xx TTL family. It is good for simple portable battery powered circuits. The 74HCTxx series is good for low power and high speed but will work at 5V. When you have problems interfacing CMOS and TTL use 74HCTxx family.