HassanF: I have edited your post on the assumption that by "customs" you mean the people who inspect passports. These are not properly called "customs," which explains @HenningMakholm's comment. If I have misunderstood, please revert.
– phoogJan 23 '17 at 15:47

2 Answers
2

To also help answer your question, this is a situation i was in just last week. Except that i flew to Frankfurt from the USA to spend a few hours there before flying back. (i am a permanent resident so i also have a schengen mine was issued by France)

Now the only variable is that i work for a major us airline, making this sort of itinerary very common for immigration authorities to see. It also removes any shroud of doubt. But i can at least answer weather 5 hrs is a good enough time.

I landed at 555am and found myself downtown via the train to Frankfurt central by 645 ( i had a hard time finding the luggage storage in FRA) my return flight was an 11am departure back to the states. I explored abit, did some photography and shopping and watched the sun rise over the river. And all in all made it back to the airport with plenty of time for my 11am departure. I was back at FRA with enough time to grab a snack prior to departure

With 4 hours though like others have suggested, i would also recommend your friends come to see you at the airport. You can pass through immigration, and there are a few restaurants/food court area that are right in the airport. This would help in making sure you do not miss your flight. But if need be the train to central station is only 17 minutes each way.

Can I exit and reenter the airport within the available time or will I miss my flight?

You probably have enough time. Your friends should travel to the airport to maximize the chance that you will see them, of course.

You will have to be prepared for any of a number of factors that could spoil your plans. Most notable among them:

A delayed incoming flight

Long queues at entry immigration when you try to get out to meet your friends

Long queues at security to re-enter the airport

Long queues at exit immigration to get to your gate

As you make your way to the outer (unsecured) area of the airport to meet your friends, have a look at the security and exit immigration queues you'll need to wait in before getting to your gate. This will give you a better idea of how much time you will need to get to your gate promptly.

Will this get me into trouble with the immigration authorities if I reenter after only a few hours?

Note that you're actually entering the Schengen area when you leave the airport and exiting it when you go to your gate.

Your valid Schengen visa will authorize you to pass through entry immigration (assuming you haven't already exhausted your 90 days' allowed stay in the previous 179 days); you will also of course have to convince the immigration officer to admit you. There's nothing wrong by itself with a plan to meet friends during your layover; people do this all the time, but of course it is impossible to predict whether in your case (or in any specific case) the immigration officer will allow it.

Finally, you have not actually given us enough information to know whether you will have to pass through immigration to leave the airport in Frankfurt. We get many questions that demonstrate a misunderstanding of the situation, so I will cover this question even though you did not ask it:

[Will I even need to pass through immigration controls to leave the airport?]

This depends on where you are coming from. The immigration considerations apply only if your arriving flight originated outside the Schengen area. In other words, if you are flying from Paris (or Ljubljana or Bilbao or any other Schengen airport), you will not need to clear entry immigration controls to leave the airport, and, whether you leave the airport or not, you will need to clear exit immigration to reach your departure gate.)