Have you ever needed to act in someone else’s name? It probably started early in life with something like this: “Mom said you better come inside now for dinner!” In effect, you were saying, “in the name of Mom, come in for dinner” because she had authorized you to pass on a message for her to someone else. And while you were sticking to the message she actually gave you, you had the authority of her name behind your words. However, if you were to say, “Mom said you had better come inside now for dinner, unless you want to let me have your dessert.” then you would no longer be within the delegated authority she gave you.

In the same way, Jesus Christ said to do many things in His name. That phrase is not some magical incantation that bestows power and whatever we want to do or say. Rather it is a statement of the authority behind saying or doing something. Thus, when Peter said, “Peter said to them, “Repent, and each of you be baptized in the name of Jesus Christ for the forgiveness of your sins; and you will receive the gift of the Holy Spirit.” (Acts 2:38 NASB) he was not giving the secret words to make your baptism work. He was stating that one should be baptized for the forgiveness of their sins because Jesus said to do so.

In the same way, we are told that when we pray we are to ask for things in Jesus’ name, and it will be granted. Does that mean that we can say anything we want and it will be given to us as long as we say “in Jesus name” at some point during the prayer? Of course not! What Jesus assured the disciples of was that if they asked for anything that He told them to ask for (i.e. in His name) that the Father would grant it. What is also implied is that if we ask for things that are not what He wants for us, then the request is not in His name. We must be careful about saying we are doing something in Jesus’ name if the Bible has not spoken of it, lest we use His name in vain. And by the way, you can pray in Jesus name without tacking on “in Jesus name” at the end, but it is a good reminder for us to check ourselves and be sure that what we are asking for in His name is really what His will is for us.

This is not overly restrictive. We are commanded to do certain things in His name.

always giving thanks for all things in the name of our Lord Jesus Christ to God, even the Father; (Ephesians 5:20 NASB)
Whatever you do in word or deed, do all in the name of the Lord Jesus, giving thanks through Him to God the Father. (Colossians 3:17 NASB)

So if what you are doing or saying is in accordance with His revealed will; if it is something good that you can be thankful to God for, then give thanks and act or speak in His name!