"Breaking the fourth wall" is when a character speaks directly to the audience in a play or through the camera in a film or television show and is used for comedic purposes. The term "breaking the fourth wall" comes from the fourth imaginary "wall" at the front of the stage in a traditional three-walled box set in theatre.
Great examples of breaking the fourth wall are present in popular television shows, like How I Met Your Mother, Fresh Prince of Bel-Air, and Scrubs. Films such as Ferris Bueller's Day Off, Spaceballs, and Jay and Silent Bob Strike Back are also guilty of having characters break the fourth wall.
Having a character completely acknowledge the audience is a fun little gag that can be very funny if it's used in the right kind of film or television show.