It's the period between Epiphany (January 6) and the start of Lent, but normally when people say Mardi Gras they mean the last day, which is also called Shrove Tuesday. It's a period of celebration and parties before people start restricting themselves during Lent, which is why you have to use up all the fats and things on Shrove Tuesday by making pancakes. The origins of religious stuff tend to take a long time to explain, but there's pancakes.