It’s well past time for a primer on the boundaries of free speech and public officials. Fortunately, Eugene Volokh of UCLA has that very post on his website. See, The First Amendment and Speech That Allegedly Threatens Public Officials.
Prof. Volokh lists seven key points for understanding First Amendment law involving allegedly threatening speech toward officials. His post is well worth reading (as is true, I think, of all his work).