A triplet is a group of three notes played in the same space of time as a group of two notes of the same note type.
Any note grouping whose value is not an even number when divided by two, must have a bracket written over it and indicate the number of notes per group, unless the time signature dictates otherwise.