A gripping mechanism for gripping an object includes a base, a first gripping module, a second gripping module, and a driving device. The first gripping module is disposed on the base and has at least one receiving slot. The second gripping module is movably disposed in the receiving slot. The driving device is disposed on the base and connected to the first gripping module and the second gripping module. The driving device is operable to drive the first gripping module to switch between an opened state and a closed state, or drive the second gripping module to move relative to the first gripping module to enable the gripping mechanism to grip or release the object.