Detained

Detained in Canadian airport
What happens if you get detained at the airport?How long can they detain you at the border?Can you be detained by customs?What possible outcomes would...