The answer to the last part of the question, in the body rather than the heading, is no. A commandment is not necessarily in the imperative. Jesus said
You shall love the Lord your God with all your heart, and with all your soul, and with all your mind. This is the great and first commandment. And a second is like it, You shall love your neighbour as yourself. On these two commandments depend all the law and the prophets. Matthew 22 37-40
This is in the future indicative tense, rather than the imperative. This applies to the original Greek, and to some modern translations. Other modern translations use the imperative in English, but the Greek text is future indicative.
In English we might be told "You will report for duty at 0600 hours". This would be a command expressed in the future indicative.
Even many of the Ten Commandments in the Old Testament are in the future indicative (e.g. "Thou shalt have none other gods but me") while others are in the imperative (e.g. "Honour thy father and mother").
Just as not all commands are imperatives, not all imperatives are commands. "Come in" called by a parent whose children are playing outside is a command, but addressed to a friend at the door is an invitation. In the Lord's Prayer we say "Give us our bread". Addressed to a servant this would be a command, to a baker a request, and to God a prayer. There is no grammatical difference and whether an imperative is a command, a suggestion, an invitation or a plea sometimes requires subjective judgement.
Apart from the two commandments mentioned by Jesus in the above passage, there are no other commands in the New Testament which are very widely referred to by the specific term "commandment"; although many could be considered as such. Some commands of Jesus or of the writers of the epistles may be considered to apply to all Christians. Some clearly applied only to a specific situation and were not intended to apply generally. When, on Palm Sunday, Jesus told two of his disciples to go and fetch a donkey, He clearly wasn't issuing a universal commandment (at least, as far as I know, nobody thinks He was). Some instructions have been argued over as to whether they applied only to those they were directly given, or to all Christians, or to the successors of the apostles (however defined).
James Boyer, of Grace Theological Seminary, counted 1,632 imperatives in the New Testament and discussed the grammatical use of the imperative, in this article