"Don't be hard on yourself" is more common. As a native speaker in the US, I have never heard "don't be strict with yourself."
"To be strict" usually describes a parent (or sometimes in the workplace, a boss) who is focused on rules. A more common sentence for this would be" "My parents were very strict." or "At work, my boss is very strict on us."
"To be hard on yourself," means not forgiving yourself for mistakes.