By speaking at the wrong time, I always put myself and my close friends in a dangerous position.
Literal
Inappropriate time [at-に], mouth [object-を] open [and-ては] I [topic-は] self [and-と] own close friends [object-を] always dangerous position [in-に] am-placing.
不適当な時に = 'at inappropriate times.' 口を開く = 'to open one's mouth / to speak.' ~ては marks a repeated action with unfortunate consequences. A confessional observation about bad timing.