How long do I hold ?

How long do I need to hold my urine for a pregnancy test! I heard the morning is better but I pee thought out the night !