Both are weak wishy-washy expressions, which I personally avoid, but if you must use them then "Nice to meet you" would be said on initially meeting the person, and "Nice meeting you" would normally be said at the end of the meeting.
Consider using instead "Pleased to meet you" on meeting somebody, and something like "Was lovely meeting you" or "Lovely to meet you" at the end of the meeting. These are much stronger expressions and will have a more meaningful (and a more genuine) impact.
Or if you want to be really formal (and sometimes you have to be), then "How do you do" is an excellent choice.