On the authority of Sayyiduna Abu Dharr Jundub Ibn Junaada رضي الله عنه and Sayyiduna Abu 'Abdur Rahmaan Mu'aadh Ibn Jabal رضي الله عنه, from the Messenger of Allaah صلى الله عليه وسلم who said,
"Fear Allaah wherever you are." 
Taqwa emanates from the root wiqaayah, which means, "he protected," or "to protect." When the word taqwa ("fear") is used with respect to Allaah سبحانه و تعالى, as in this hadeeth, it means that one must fear or protect himself from Allaah's anger and punishment. This is the greatest thing that one must protect oneself from. It is the source of Allaah's punishment in both this world and the Hereafter. Allaah سبحانه و تعالى says in the Qur'an,
"Let not the believers take the disbelievers as Auliya (supporters, helpers, etc.) instead of the believers, and whoever does that will never be helped by Allaah in any way, except if you indeed fear a danger from them. And Allaah warns you against Himself (His Punishment), and to Allaah is the final return." (Soorah Aal 'imraan, 3:28)
Hence, the person must do what he can to avoid and protect himself from earning the anger of Allaah سبحانه و تعالى. He does this by being sincere to Allaah سبحانه و تعالى, by performing what Allaah سبحانه و تعالى has ordered and remaining away from what Allaah سبحانه و تعالى has prohibited. This is, in essence, taqwa.
This portion of the hadeeth may be understood in different ways. However, they are all somewhat compatible and may all be meant by these words.
One implication is that a person should "fear Allaah" when he is with others as well as when he is all alone. Allaah سبحانه و تعالى knows everything that everyone does as well as what anyone even considers in their hearts. Under all circumstances, one must be on his best behaviour and avoid what may displease Allaah سبحانه و تعالى, for Allaah سبحانه و تعالى is watchful of all things. Allaah سبحانه و تعالى has stated,
"O mankind, fear your Lord, who created you from one soul and created from it its mate and dispersed from both of them many men and women. And fear Alalah , through whom you ask one another, and the wombs. Surely, Allaah is Ever an All-Watcher over you." (Soorah an-Nisaa', 4:1)
The Prophet صلى الله عليه وسلم used to supplicate to Allaah سبحانه و تعالى,
'I ask of You to give me fear of You in matters that are seen as well as those that are witnessed.' 
If a person realises that Allaah سبحانه و تعالى sees him at all times and knows what he does in secret, he will then avoid committing sins even when he is in complete privacy. This is a sign of complete Imaan in his heart. However, constantly failing to obey Allaah سبحانه و تعالى when one is alone is a sign of a diseased heart, like the hearts of the hypocrites. 
Allaah سبحانه و تعالى says about them,
"They conceal [their evil intentions and deeds] from the people, but they cannot conceal [them] from Allaah , and He is with them [in His knowledge] when they plot by night in words that He does not approve, And Allaah ever encompasses what they do." (Soorah an-Nisaa', 4:108)
A second implication is that one must "fear Allaah" while in a state of blessings or trial.
A third implication - which is the only meaning given to this expression by Abu Bakr Ibn al-'Arabi رحمه الله in his commentary to Sunan at-Tirmidhi - is that one must "fear Allaah" while one is alone or while one is among any group of people, whether they are pious or impious. The person must tend to himself and cannot use others as an excuse for disobeying Allaah.  
 Recorded by at-Tirmidhi who said it is a Hasan Hadeeth
 Recorded by an-Nisaa'ee and Ibn Hibbaan. According to Shuaib al-Arnaoot, it is Saheeh. See Shuaib al-Arnaoot's footnotes to Ibn Rajab, Jaami', vol. 1, p. 407. Although the word used by the Prophet صلى الله عليه وسلم in that hadeeth is khashya (which is closer to a direct meaning of fear), such fear is one of the components of taqwa and the two words are many times close in significance.
 Sultaan, p. 162
 Abu Bakr Ibn al-'Arabi, Aaridhat al-Ahwadhi bi-Sharh Saheeh at-Tirmidhi (Beirut: Daar al-Kutub al-Ilmiyyah, n.d.), vol. 8, pp. 154-155
 Shaykh Jamaaluddeen Zarabozo, Commentary on the Forty Hadeeth of Imam An-Nawawi رحمه الله, vol. 1, pp. 574-575