1. How many times have you been knocked down in life?
2. How many times have you been knocked out in life?
1. How many times have you been knocked down by hardships?
2. How many times have you been knocked out by hardships?
"in life" is more often used than "by life".
Source: asking Google :)
"knocked down in life" — 335,000 results
"knocked down by life" — 22,200 results
"knocked out in life" — 1,510,000 results
"knocked out by life" — 49,200 results
... and I think it is because "in lifetime", so it is period of time
"by" is more about of usage for some tool or method
“It's not how many times you get knocked down that count, it's how many times you get back up. ”
George A. Custer // U.S. Military
You may be knocked down, But not out forever,
Lose our way, Get back up again,
So get up, get up, You gonna shine again!
Toby Mac, song "Get Back Up"