An earthquake can last for just a few short seconds or go on for several long minutes.
You would feel the ground shake in a magnitude 3 quake.
You may not notice a magnitude 2 quake.
Sometimes there are many small earthquakes before the big one. These small ones are called foreshocks. After the big earthquake, the mainshock, again there may be many small quakes. These are called aftershocks.