1. He got a nice gift for his birthday.

2. He gave me a present for Christmas.
3. I received a fountainpen for my birthday.
4. She got a ring for the wedding anniversary.
5. Tom gave me a nice bike for my birthday.
--------------------
Are they all grammatical? They have a preposition plus a noun clause in the end. Are they all adjective phrases or adverbial phrases?

In 3, I'd say "fountain pen" and in 4, I'd say "their wedding anniversary" but other than those two things, all are fine.

Adverbs answer one of these four questions: How? When? Where? and Why?
http://www.chompchomp.com/terms/adverb.htm
Which of those questions are those prepositional phrases answering?

Yes, all of the sentences you provided are grammatically correct. They all contain a preposition followed by a noun clause.

In terms of classification, these structures can be considered adjective phrases or adverbial phrases depending on how they are used in the sentence.

Let's analyze each sentence:

1. "He got a nice gift for his birthday."

In this sentence, the preposition "for" introduces the noun clause "his birthday." Since the noun clause is functioning as an object of the preposition and providing additional information about the gift, this structure can be considered an adjective phrase modifying the noun "gift."

2. "He gave me a present for Christmas."

Similarly, the preposition "for" introduces the noun clause "Christmas." In this case, the noun clause is serving as an object of the preposition and providing information about the time or occasion of the gift. Therefore, this structure can also be considered an adjective phrase modifying the noun "present."

3. "I received a fountain pen for my birthday."

Once again, the preposition "for" introduces the noun clause "my birthday." Here, the noun clause acts as an object of the preposition, indicating the reason or purpose behind receiving the fountain pen. This structure is also an adjective phrase modifying the noun "pen."

4. "She got a ring for the wedding anniversary."

In this sentence, the preposition "for" introduces the noun clause "the wedding anniversary." The noun clause functions as an object of the preposition, providing information about the occasion for receiving the ring. Hence, this structure is an adjective phrase modifying the noun "ring."

5. "Tom gave me a nice bike for my birthday."

Once more, the preposition "for" introduces the noun clause "my birthday," which acts as an object of the preposition. The noun clause specifies the reason or occasion for receiving the bike. Consequently, this structure is an adjective phrase modifying the noun "bike."

To summarize, all the sentences feature prepositions followed by noun clauses functioning as either objects of the prepositions or providing additional information about the nouns. These structures can be considered adjective phrases modifying the preceding nouns.