The question concerns the gifts Peter referenced from Joel 2:28-29.
"And it shall come to pass afterward, that I will pour out my spirit upon all flesh; and your sons and your daughters shall prophesy, your old men shall dream dreams, your young men shall see visions:
29 And also upon the servants and upon the handmaids in those days will I pour out my spirit." (KJV)
These are the gifts that Peter referred to, saying specifically,
"16 But this is that which was spoken by the prophet Joel; 17 And it shall come to pass in the last days, saith God, I will pour out of my Spirit upon all flesh: and your sons and your daughters shall prophesy, and your young men shall see visions, and your old men shall dream dreams: 18 And on my servants and on my handmaidens I will pour out in those days of my Spirit; and they shall prophesy:" (Acts 2:16-18, KJV)
Peter restated the prophesy from Joel 2:28-29 when he denied the claims of the hecklers who were saying the apostles were drunk.
The gifts from the prophesy of Joel were those that Peter said would be poured out upon those who were baptized / immersed into Christ. Those gifts of the Spirit were prophesy, dreams, visions, speaking and interpreting foreign languages (tongues), healing. These were super-natural gifts that the Spirit enabled in those who were anointed in Christ.
These were publicly demonstrated, visible to the people as miracles in order to confirm the word, the gospel of Christ to the assemblies so that they could know of the kingdom of God, of Christ's sacrifice for them (and us) and so they could believe that Jesus was the Messiah.
The gifts were not an automatic result of their anointing / immersion. They were given through the laying on of the hands of the apostles AFTER the anointing, and were selective.
"9 But there was a certain man, called Simon, which beforetime in the same city used sorcery, and bewitched the people of Samaria, giving out that himself was some great one:....
"13 Then Simon himself believed also: and when he was baptized, he continued with Philip, and wondered, beholding the miracles and signs which were done. 14 Now when the apostles which were at Jerusalem heard that Samaria had received the word of God, they sent unto them Peter and John: 15 Who, when they were come down, prayed for them, that they might receive the Holy Ghost:"
"16 (For as yet he was fallen upon none of them: only they were baptized in the name of the Lord Jesus.) 17 Then laid they their hands on them, and they received the Holy Ghost. 18 And when Simon saw that through laying on of the apostles' hands the Holy Ghost was given, he offered them money,"
"19 Saying, Give me also this power, that on whomsoever I lay hands, he may receive the Holy Ghost. 20 But Peter said unto him, Thy money perish with thee, because thou hast thought that the gift of God may be purchased with money. 21 Thou hast neither part nor lot in this matter: for thy heart is not right in the sight of God."
"22 Repent therefore of this thy wickedness, and pray God, if perhaps the thought of thine heart may be forgiven thee. 23 For I perceive that thou art in the gall of bitterness, and in the bond of iniquity. 24 Then answered Simon, and said, Pray ye to the Lord for me, that none of these things which ye have spoken come upon me." (Acts 8:9, 13-24, KJV)
Not everyone was given the gifts of the Spirit. This is why Paul told Timothy,
"Lay hands suddenly on no man, neither be partaker of other men's sins: keep thyself pure." (1 Tim 5:22, KJV)
The Holy Spirit guided the apostles and those they designated to help them so they would know who were truly repentant and worthy of the gifts. They were super-natural, miraculous, adding power and strength to the chosen ones who would do the work of the Spirit for the spreading of the gospel to the known world of that day. The entire purpose was to prove God's word was truly from God so the people would believe.
The gifts were not permanent. Paul told them that when that which was perfect had come those miraculous gifts would fade away (1 Cor. 13:1-10). The word perfect meant complete. Knowing in part, or partially, or some meant that each gift only allowed some knowledge to those that had been given a particular gift. The knowledge would be complete when the books of the NT were circulated and the destruction of Jerusalem had been accomplished.
That which was completed, or perfect was the establishment of the kingdom after the earthly temple had been destroyed. The gifts would die out after the apostles died because they would no longer be laying hands upon those anointed in Christ. Peter told them,
"For the promise is unto you, and to your children, and to all that are afar off, even as many as the Lord our God shall call." (Acts 2:39, KJV)
The promise of the miraculous gifts of Joel 2: 28-29 were time limited to those that heard Peter on the day of Pentecost, to their children, and to the gentiles who were yet "far off" that would be grafted in.
The gifts of the Spirit were visibly seen and witnessed by the people in greater abilities as miraculous powers. We do not have those miraculous gifts today. When we are anointed (immersed) into Christ we have the promise of eternal life with our Father in heaven, and forgiveness of sins, of being clothed with Jesus' righteousness, and of being reunited in heaven with all of our fellow brothers and sisters in Christ who have gone before us.
That is because we have the written word of God through the scriptures He has preserved for us. He has given us all things pertaining to life and godliness (2 Pet.1:3). If we want to know the gospel of Christ and the plan of salvation we can read about it through the words of Holy Spirit.... which word was first proved to those of the 1st century AD by the miraculous gifts of the spirit.
The work of the Holy Spirit is spoken of in the OT in the same terms of greater strength and power, of prophesy and visions / dreams, of interpretation, of healing whenever the Spirit of the Lord came upon the chosen of God (Num. 11:25; Jud. 14:6; 15:14; Ex. 31:3-5; 1 Chron. 12:18; 1 Sam. 10:1-6; 1 Sam. 16:12-13; etc). The gifts were always to prove the will and the word of the Father; they always confirmed the word.
Additional reading: Gifts of the Spirit in the Old Testament